Response formats

One search resource, six spellings of the answer. Pick with format=; JSON is the default and the one the others are described in terms of.

formatContent-TypeShape
jsonapplication/jsonOne object, results in an array.
ndjsonapplication/x-ndjsonOne JSON object per line. The first line is the metadata, tagged "object":"meta".
xmlapplication/xmlThe same document as XML, rows as <result>.
csvtext/csvSemicolon separated, no header line.
tsvtext/tab-separated-valuesAs CSV, tab separated.
txttext/plainOne url per line.

jsonl is accepted as another name for ndjson.

The files the results page on the site gives - the URLs, CSV and CSV+snippets buttons - are described in Downloading results.

Which to use

json for anything that fits in memory. ndjson for anything that does not: there is no enclosing array to wait for, the metadata arrives before the rows, and a reader can start work on the first result while the rest is still arriving. csv, tsv and txt for spreadsheets and shell pipelines.

ndjson

{"object":"meta","query":"\"angular.min.js\"","page":1,"per_page":2,"total":70907,"total_pages":35454,"returned":2,"truncated":false,"index_complete":true,"took_ms":2}
{"domain":"imgbox.com","url":"https://imgbox.com/","rank":4187,"ranked":true}
{"domain":"angularjs.org","url":"https://angularjs.org/","rank":12376,"ranked":true}

Choosing the columns

json and xml return every field. The flat formats default to the familiar ones instead, so a script coming from the old export urls needs no parser change:

RequestOutput
format=csvimgbox.com;4187
format=csv&columns=url,rankhttps://imgbox.com/;4187
format=csv&columns=domainimgbox.com
format=txthttps://imgbox.com/
format=csv&snippets=1imgbox.com;4187;the matching text;the page title
format=csv&header=1a domain;rank line first
format=csv&delimiter=,imgbox.com,4187

With depth: other than 0 in the query, a row is a page, and in csv and tsv the rows of one website look alike: to see which page it is, ask for url - columns=domain,rank,url.

columns works for every format, so format=json with columns=domain returns objects with only that field.

Details of the flat formats

The flat formats are the new API's own; only the old urls promise the old exports byte for byte.

Formats and errors

csv, tsv and txt fit search results only; anywhere else, /v1/account included, they are 400 format_not_available - except csv on /v1/clusters/{id}/extract (comma separated by default; delimiter changes it - see Clusters) and txt on /v1/clusters/{id}, one domain per line. On cluster endpoints a refused format spends and changes nothing. Errors come back as JSON, or as XML if asked for - see Errors.

Next Quotas and rate limits