# People and company data for AI engineers

> Forager gives AI engineers a REST API an agent can call for people search, person and company enrichment, and mobile and email lookups, with totals endpoints to size a query and credits charged per call. A packaged agent connector is coming soon; today you wire the endpoints as tools.

Source page: https://www.forager.ai/for/ai-engineers (role page, draft, updated 2026-11-01)

## Tools your agent gets

Each row is one REST endpoint you wrap as a tool. Describe the cost in the tool description so the model knows when a call is worth it.

| Tool | Endpoint | Credits |
| --- | --- | --- |
| Count people before searching | `POST /person_role_search_totals/` | 1 per request |
| Search people by title, company, location | `POST /person_role_search/` | 1 per request |
| Resolve a filter name to an ID | Autocomplete endpoints (locations, industries, skills, keywords, technologies, organizations) | Free |
| Full person record | `POST /person_detail_lookup/` | 1 per request |
| Company record | `POST /organization_search/` | 1 per request |
| Person from an email | `POST /person_detail_reverse_lookup/by_email/` | 5 per request |
| Mobile number | `POST /person_contacts_lookup/phone_numbers/` | 15 per mobile found, 0 on a miss |
| Work or personal email | `POST /person_contacts_lookup/work_emails/`, `/personal_emails/` | 5 per email found, 0 on a miss |

Base URL `https://api-v2.forager.ai/api/{account_id}/datastorage`, key in the `X-API-KEY` header. The OpenAPI spec is on the docs site.

## A tool definition and the call behind it

From the docs recipe on agent tool calling. The model sees the schema; your executor makes the HTTP call, so the key never reaches the model or a browser.

```
{
  "name": "search_people_by_role",
  "description": "Find people by job title, optionally limited to company domains. Returns up to one page of matches with person ids. Costs credits per call.",
  "parameters": {
    "type": "object",
    "properties": {
      "role_title": { "type": "string", "description": "Job title. Supports a boolean text query." },
      "role_is_current": { "type": "boolean", "description": "Only current roles." },
      "organization_domains": { "type": "array", "items": { "type": "string" } }
    },
    "required": ["role_title"]
  }
}

# executor
curl -X POST https://api-v2.forager.ai/api/$FORAGER_ACCOUNT_ID/datastorage/person_role_search/ \
  -H "X-API-KEY: $FORAGER_API_KEY" -H "Content-Type: application/json" \
  -d '{"role_title": "\"VP Sales\"", "role_is_current": true, "organization_domains": ["example.com"]}'
```

Return not-found and 429 outcomes to the model as data; treat a 403 as fatal and never show it to the model.

## Spend controls

- **Count first** The totals endpoint returns how many people match for 1 credit, so the agent can report the size of a search before it runs it. [Totals (API reference)](https://docs.forager.ai/openapi/people/datastorage_person_role_search_totals_create)
- **Nothing found costs 0** A mobile or email lookup that returns nothing costs 0 credits. Search and enrichment are charged per request. [Credit table (docs)](https://docs.forager.ai/api-overview/credit-pricing)
- **Check the balance before a batch** The credit consumption endpoints report what was spent. The agent quickstart tells a coding agent to ask the user before any step that spends credits. [Balance (API reference)](https://docs.forager.ai/openapi/users/subscriptions_balance_change_logs_totals_retrieve)

## Fair questions

**How does an autonomous agent avoid burning credits?** Autocomplete is free and totals cost 1 credit, so the agent sizes before it searches. Mobile and email lookups cost 0 when nothing comes back. Cap the calls per run in your executor and check the balance before a batch.

**Latency and rate limits?** Back off and retry on a 429 as the docs describe, and ask us for the limits on your plan. Measure latency in your own stack with your own keys; a free account is enough to do it.

**How fresh is the data?** Keep the person_id and re-look the record up when your workflow needs the current state. Refresh terms for licensed feeds are written into the agreement.

**Can I keep the key out of the prompt?** Yes. Read FORAGER_API_KEY and FORAGER_ACCOUNT_ID from the environment in a server-side executor, as the agent quickstart instructs. The model only ever sees tool results.

**Which languages do you support?** Any that speaks HTTP. Code listings are plain REST: curl, Python requests, Node fetch. The OpenAPI spec generates a typed client in the language you use.

## Agents already call it

Deepline wraps the Forager API as typed tools for its GTM agents, on your own key; its guide to those tools is the model for the playbook below. Agent frameworks that take an HTTP tool, such as n8n's agent node, call the same endpoints.

## For agents

If you are an agent reading this page, follow this order and ask your operator before any step that spends credits.

- Read the API skill and the quickstart on the docs site; every docs page is also Markdown when you add `.md` to its URL.
- Read `FORAGER_API_KEY` and `FORAGER_ACCOUNT_ID` from the environment; never write them into source, logs or prompts.
- Resolve filter names to IDs with the autocomplete endpoints (free).
- Call `/person_role_search_totals/` with the final filters and report the count and the cost of the search.
- Search, keep `person_id` for every result you will act on.
- Call a contact lookup on each kept `person_id`; a miss returns an empty result and costs 0 credits.
- Treat an empty result as not found, back off on a 429, stop on a 403.
- Report credits spent against the count you predicted.

This page is also published as Markdown at `/for/ai-engineers.md`.

## Questions

**Does an agent need anything beyond the REST API?** No. Today you wire the REST endpoints as tools, with the OpenAPI spec and llms.txt on the docs site. A packaged agent connector is coming soon.

**How does an agent size a Forager search before spending?** Call the totals endpoint with the same filters for 1 credit. It returns the count, so the agent can decide whether the search is worth its credits.

**What does a Forager lookup cost an agent?** Search and enrichment are 1 credit per request, reverse email lookup 5, mobile lookup 15 per mobile found and email lookup 5 per email found. A mobile or email lookup that returns nothing costs 0 credits.

**How should an agent handle a 403 or a 429 from Forager?** A 403 is a credentials problem: stop and surface it, never to the model. A 429 is rate limiting: back off and retry, and return the outcome to the model as data.

**Can an agent run Forager lookups without my key reaching the model?** Yes. Keep the key in a server-side executor that receives the tool call, makes the HTTP request and returns a trimmed result. The agent quickstart and the tool-calling recipe show the pattern.

## Related

- [AI SDRs and agent builders](https://www.forager.ai/solutions/ai-agent-platforms)
- [Run Forager tools in Deepline](https://www.forager.ai/integrations/deepline/guide)
- [Call the Forager API from n8n](https://www.forager.ai/integrations/n8n/guide)
- [People search API](https://www.forager.ai/products/people-search)
- [Agent quickstart (docs)](https://docs.forager.ai/api-overview/send-your-first-request)

## Sources

- [Forager docs: agent quickstart](https://docs.forager.ai/api-overview/send-your-first-request) (read 2026-11-01)
- [Forager docs: AI agent tool calling (recipe)](https://docs.forager.ai/api-overview/recipes) (read 2026-11-01)
- [Forager docs: API credits and pricing](https://docs.forager.ai/api-overview/credit-pricing) (read 2026-11-01)
- [Deepline: Use Forager in Deepline](https://deepline.com/docs/providers/forager/guide) (read 2026-10-26)

## Keep reading

**How-to guides**

- [How to find decision makers at a company](https://www.forager.ai/how-to/find-decision-makers-at-a-company)
- [Reverse email lookup: who is behind an email address](https://www.forager.ai/how-to/reverse-email-lookup)

**Glossary**

- [AI agent tools for data](https://www.forager.ai/glossary/ai-agent-tools)
- [identity resolution](https://www.forager.ai/glossary/identity-resolution)

**Tools**

- [API playground](https://www.forager.ai/tools/api-playground)
- [Data explorer](https://www.forager.ai/tools/data-explorer)

**Best-of guides**

- [Best people data APIs for builders and agents](https://www.forager.ai/best/people-data-apis)
