The old export urls
Before there was an API, results were downloaded by adding ?export=
and a key to an ordinary search url. Those urls still work, exactly as they
always have, byte for byte. They are not going away.
https://publicwww.com/websites/%22angular.min.js%22/?export=csv&key=YOUR_KEY
export= | Returns |
|---|---|
urls | One url per line. |
csv | domain;rank |
csvu | url;rank |
csvsnippets | domain;rank;snippet |
csvsnippetsu | url;rank;snippet |
cluster | Saves the results as a cluster instead of downloading them. |
&delimiterColumns= and &delimiterSnippets=
change the separators, and
https://publicwww.com/profile/api_status.xml?key=... reports the
day's usage as XML.
Why they are separate
These urls are the compatibility layer, and keeping them that way is what lets the API be a normal modern one. Their output is pinned byte for byte by a test that runs on every change, so a script written years ago keeps parsing what it has always parsed. Nothing new is added to them.
Moving a script over
The nearest equivalents:
| Old | New |
|---|---|
?export=csv | format=csv |
?export=csvu | format=csv&columns=url,rank |
?export=urls | format=txt |
?export=csvsnippets | format=csv&snippets=1 |
?export=csvsnippetsu | format=csv&columns=url,rank,snippets&snippets=1 |
&key= | Authorization: Bearer |
&delimiterColumns= | delimiter= |
| the query in the url path | query=, or a JSON body |
api_status.xml | /v1/account |
The columns line up, so a parser usually does not change. What does change is worth having:
- A bad key is
401with a JSON body, not200with the wordsWrong API keyin it where the rows should be. - Arriving too fast is
429straight away with aRetry-After, instead of the connection being held open for up to half a minute and then refused. - A spent quota is an error. On the old urls it quietly drops you to free-tier limits and returns fewer rows, with nothing in the response saying so.
- A shortened answer is marked -
X-Truncated. - Paging, so a client need not download everything to look at the first twenty.
One thing does not carry over: filetype:css and
filetype:js searches run against a separate older index and work
on the website only. Asking for them through the API is
400 unsupported_query rather than a silently empty result.