Recipes
This section provides step-by-step API usage examples. Below, you'll learn how to search for a person by job title, extract their id
from the response, and use that ID to perform a phone number lookup.
Search for a Person by Job Title
Use the Person Role Search API to find a person by job title. The request below searches for "Software Engineer".
Request
curl -X POST "https://api-v2.forager.ai/api/{account_id}/datastorage/person_role_search/" \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"role_title": "Software Engineer",
"role_is_current": true
}'
Sample Response
{
"search_results": [
{
"id": 123456,
"person": {
"full_name": "John Doe",
"location": "San Francisco, CA"
},
"role_title": "Software Engineer",
"organization": {
"name": "Tech Corp"
}
}
],
"total_search_results": 1
}
Extract the id value (123456 in this case) for the next step.
Look Up a Person's Phone Number
Once you have the id, use the Person Phone Number Lookup API to retrieve phone number details.
Request
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": 123456
}'
Sample Response
[
{
"phone_number": "+14155552671"
}
]