- 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.
Make a Request
Send aGET 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.
requestId is the only parameter. A request with any other query parameter is rejected with a 400 status.
404.
Response
The response has the same data as the original response, with a newrequestMetadata object:
The original
requestMetadata fields such as url, html and json are not part of an archive response.
Google Links Resolved After the 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:
Link Resolution Status
Responses from Google APIs carryrequestMetadata.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.
Fetch the Resolved Links
- Send your Google request as usual and check
requestMetadata.linkResolutionStatus. - If it is
inProgress, keeprequestMetadata.id. - 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
completedor when you no longer need the links.
inProgress.
completed, and any link still unresolved stays a Google redirect URL.
Errors
An error response carries amessage: