Skip to main content
HasData keeps a copy of the result of each API request. The Search Archive API returns that copy by its request ID, so you can read a result again without running the request again. Use it to:
  • Pick up Google links resolved after the response. Some Google result links cannot be resolved before the response is sent. HasData keeps resolving them and updates the stored result. See Google Links Resolved After the Response.
  • Recover a response you did not receive, for example after a client timeout or a dropped connection.
Archive requests are free. They use no API credits, do not count toward your concurrency limit, and work even when your plan is out of credits.

Make a Request

Send a GET request to https://api.hasdata.com/search/archive with the ID of the earlier request. Authenticate with your API key in the x-api-key header, as for any other HasData API.
string
required
The ID of the earlier request, from requestMetadata.id in its response.
requestId is the only parameter. A request with any other query parameter is rejected with a 400 status.
You can read the results of any request made in your workspace. The result is stored right after the original response is sent, so an archive request sent at the same moment can still return 404.

Response

The response has the same data as the original response, with a new requestMetadata object:
The original requestMetadata fields such as url, html and json are not part of an archive response. Links in Google results lead to their destinations through encrypted Google redirect links (/goto?url=...). HasData resolves these links, so the link fields in a response carry the destination URLs. Google limits how many of a page’s links it resolves at once, so a response can be sent before every link is resolved. A link that is not resolved yet comes back as a Google redirect URL on the Google domain of your search:
HasData keeps resolving these links after the response and writes the destinations into the stored result. Fetch the result from the Search Archive to get them. You pay for the search once, because archive requests are free. Responses from Google APIs carry requestMetadata.linkResolutionStatus, both in the original response and in the archive: Responses from other APIs have no linkResolutionStatus. If the field is missing, no links are being resolved, and the stored result does not change after the response. A completed result can still contain a few Google redirect URLs: links that Google would not resolve stay as they are. Treat them as unresolved.
  1. Send your Google request as usual and check requestMetadata.linkResolutionStatus.
  2. If it is inProgress, keep requestMetadata.id.
  3. Fetch the result from the Search Archive later. Space out your retries, for example by doubling the wait each time, and stop when the status is completed or when you no longer need the links.
How long resolution takes depends on how many links are waiting, so there is no fixed time to wait. Until resolution finishes, the archive returns the result as it was first sent, with inProgress.
A request sent with Zero Data Retention stores no result. Its links are not resolved after the response, so it always comes back with completed, and any link still unresolved stays a Google redirect URL.

Errors

An error response carries a message: