Skip to content
Last updated

Welcome to Forager.ai! This guide will walk you through sending your first API request to our Phone Number Lookup API using curl.


Prerequisites

Before making a request, ensure you have:

  • An API Key: Sign up for a free account at app.forager.ai and obtain your API key.
  • A Terminal or Command Line Interface (CLI): You’ll need this to execute curl commands.

Example: Phone Number Lookup API Request

To look up details for a phone number, send a POST request to the Phone Number Lookup API endpoint.

Request Format

curl -X POST "https://api-v2.forager.ai/api/{account_id}/datastorage/person_contacts_lookup/phone_numbers/" \
     -H "Content-Type: application/json" \
     -H "X-API-KEY: YOUR_API_KEY" \
     -d '{
           "linkedin_public_identifier": "billgates"
         }'

You can also look up by using a person Forager ID, see example below:

curl -X POST "https://api-v2.forager.ai/api/{account_id}/datastorage/person_contacts_lookup/phone_numbers/" \
     -H "Content-Type: application/json" \
     -H "X-API-KEY: YOUR_API_KEY" \
     -d '{
           "person_id": 123
         }'

See examples of how to find a person id in the recipes doc.

Understanding the Request

  • Replace {account_id} with your Forager.ai account ID.
  • Replace YOUR_API_KEY with your actual API key.
  • Modify the linkedin_public_identifier field with the number you wish to look up.

Error Handling

If authentication fails, you will receive one of the following responses:

Status CodeMessageDescription
401UnauthorizedAPI key is missing or incorrect.
403ForbiddenAPI key does not have permission to access the resource.