Skip to main content
API key authentication: send the X-API-KEY header with every Forager request; a missing key returns 403API key authentication: send the X-API-KEY header with every Forager request; a missing key returns 403
To interact with Forager.ai’s API, you must authenticate every request using your API key. This ensures secure access to our data services.

Obtaining an API key

  1. Sign up for an account at app.forager.ai.
  2. Navigate to the API section.
  3. Create and copy your API key – you’ll need this for all API requests.

Using your API key

Forager.ai uses API key authentication via the X-API-KEY header. You must include this key in all requests to successfully access the API.

Example: Sending an Authenticated API Request

Below is an example of how to make a request to the Person Phone Number Lookup API using curl with your API key.

Explanation

  • Set FORAGER_ACCOUNT_ID to your Forager Account ID and FORAGER_API_KEY to your API key first, for example with export FORAGER_API_KEY="your-api-key" and export FORAGER_ACCOUNT_ID="your-account-id".
  • The X-API-KEY header must be included in every request to authenticate.
  • The API will return an error if the key is missing or invalid.

How a request is authenticated

The key identifies you; the Account ID in the path names the account the key must belong to. A valid pair returns 200 with JSON. A missing header returns 403 with Authentication credentials were not provided., and a key that cannot access the account in the path returns 403 Forbidden. See errors and rate limits.
Authentication flow: create a key in the Web App, export the key and Account ID, send the X-API-KEY header; a valid key returns 200 JSON and a missing or wrong key returns 403Authentication flow: create a key in the Web App, export the key and Account ID, send the X-API-KEY header; a valid key returns 200 JSON and a missing or wrong key returns 403
Step through the same flow, with the request and the two responses:
Last modified on November 1, 2026