PERIPHERY_API_KEY is already set in your environment. See Authentication for key creation and headers.
Page through every result
Search returns 50 hits per page. This loop prints every matching hostname and waits between requests to stay within the one-request-per-second limit.total and an empty hits array.
Fetch the full record for one hit
Search hits are summaries. Use the hostname as the stable identifier when you need the screenshot URL, extracted text, emails, or credential findings.404 means there is no current live app record for that hostname. Hosts that Periphery later proves dead also return 404.
Find apps with verified credential findings
Thehas:creds filter keeps apps with at least one verified credential finding.
credentials array contains raw strings when findings exist.
Keep credential-bearing responses out of logs
API app records can contain raw credential strings. Avoid dumping complete responses into CI logs, chat systems, tickets, analytics, or third-party AI tools unless your organisation has explicitly approved that data flow. Select only the fields the next system needs. For example:credentials array out of the output.
Retry the errors that are retryable
429 rate limit: 1 request per second: wait at least a second before the next request.502 search backend error: retry after a short delay.401and403: fix the key or plan instead of retrying.404 app not found: treat the record as unavailable rather than repeatedly polling it.