Skip to content
Referer parser library
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.formatter.exs provides access to default database config Mar 25, 2019
.gitignore adds static referers.yml for benchmark Jul 15, 2018
LICENSE Improve usage documentation examples May 10, 2019


Referer parser library.

Package Setup

To use RefInspector with your projects, edit your mix.exs file and add the required dependencies:

defp deps do
    # ...
    {:ref_inspector, "~> 1.0"},
    # ...

If you want to use a manual supervision approach (without starting the application) please look at the inline documentation of RefInspector.Supervisor.

Application Configuration

Out of the box the default database will be stored in the :priv_dir of :ref_inspector. Both the database(s) and path used can be changed.

For a detailed list of available configuration options please consult RefInspector.Config.

Referer Database

The default database is taken from the snowplow-referer-parser project.

Internal Domains

To exclude some domains from parsing you can mark them as internal using your configuration:

config :ref_inspector,
  internal: ["", ""]

If a referer matches at least one of the configured domains (== ends with, paths ignored!), it will return a result with the medium :internal. Both :source and :term will be left at the initial/unknown state not intended for further processing.

Basic Usage

Database Download

You need to obtain a copy of the configured database by calling either mix from the command line or from within your application.

Refer to RefInspector.Downloader for more details.

Referer Parsing

iex(1)> RefInspector.parse("")
  medium: "search",
  referer: "",
  source: "Google",
  term: "ref_inspector"

Full documentation is available inline in the RefInspector module and at


Several (minimal) benchmark scripts are included. Please refer to the Mixfile or mix help output for their names.



Apache License, Version 2.0

Referers.yml taken from the snowplow-referer-parser project. See there for detailed license information about the data contained.

You can’t perform that action at this time.