%h1 API

%p The API allows you to programatically retrieve data from any public scraper using an SQL query. It's all pretty easy.

%pre
  %code http://127.0.0.1:3000/<em>[scraper]</em>/data.json?query=<em>[sql]</em>

%h2 parameters

%dl
  %dt <em>[scraper]</em>
  %dd The full name of the scraper as seen in the url (e.g. #{@scraper.full_name})
  %dt <em>[sql]</em>
  %dd
    The SQL query to perform on the SQLite database that is the output of the scraper (e.g. "#{@query}").
    Ensure it is #{link_to "url encoded", "https://en.wikipedia.org/wiki/Percent-encoding"}.

%p
  For example, to retrieve data from the
  = link_to "#{@scraper.full_name} scraper", @scraper
  with the SQL query "#{@query}"

%pre
  %code= link_to scraper_data_url(@scraper, query: @query, format: :json), scraper_data_url(@scraper, query: @query, format: :json)

%h1 API

%p The API allows you to programatically retrieve data from any public scraper using an SQL query. It's all pretty easy.

%pre
  %code #{root_url}<em>[scraper]</em>/data.json?query=<em>[sql]</em>

%h2 parameters

%dl
  %dt <em>[scraper]</em>
  %dd The full name of the scraper as seen in the url (e.g. #{@scraper.full_name})
  %dt <em>[sql]</em>
  %dd
    The SQL query to perform on the SQLite database that is the output of the scraper (e.g. "#{@query}").
    Ensure it is #{link_to "url encoded", "https://en.wikipedia.org/wiki/Percent-encoding"}.

%p
  For example, to retrieve data from the
  = link_to "#{@scraper.full_name} scraper", @scraper
  with the SQL query "#{@query}"

%pre
  %code= link_to scraper_data_url(@scraper, query: @query, format: :json), scraper_data_url(@scraper, query: @query, format: :json)

Fix displayed url when not in development
Fix displayed url when not in development
