Skip to main content
These examples assume 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.
A page past the end is also safe: it returns the same 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.
A 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

The has:creds filter keeps apps with at least one verified credential finding.
Use the app endpoint only for records you actually need to inspect. Its 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:
This keeps the raw 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.
  • 401 and 403: fix the key or plan instead of retrying.
  • 404 app not found: treat the record as unavailable rather than repeatedly polling it.
See Limits and errors for the complete error table.