> ## Documentation Index
> Fetch the complete documentation index at: https://www.datalegion.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Firecrawl Alexandria

> Call Data Legion person and company enrichment through Firecrawl Alexandria. Capabilities, inputs, response shape, and setup for agents already on Firecrawl.

Data Legion is a provider on [Firecrawl Alexandria](https://www.firecrawl.dev/blog/introducing-alexandria-series-b), Firecrawl's catalog of data providers for agents. If your agent already uses Firecrawl, it can call Data Legion person and company enrichment with its Firecrawl API key. You don't need a Data Legion account or API key, and usage is billed in Firecrawl credits.

## Prerequisites

* A Firecrawl account and API key
* An organization admin who has accepted Data Legion's data terms in the Firecrawl dashboard (see [Accept the data terms](#accept-the-data-terms))
* The Firecrawl SDK: `pip install firecrawl-py` or `npm install @mendable/firecrawl-js`

## Capabilities

Data Legion is listed under People and Company. The provider name is `datalegion`.

| Capability | Data Legion product | Returns |
| - | - | - |
| `people/enrich-base-no-contact` | Person Base | Identity, current role and company, work history, education, skills, social profiles |
| `people/enrich-base-with-contact` | Person Base with contact data | Person Base plus emails, phones, location, age, and sex |
| `people/enrich-premium-no-contact` | Person Premium | Person Base plus seniority, job function, decision-maker flag, tenure, and data freshness |
| `people/enrich-premium-with-contact` | Person Premium with contact data | Person Premium plus emails, phones, location, age, and sex |
| `companies/enrich-base` | Company Base | Firmographics: name, domains, industry, size, type, founding year, description |
| `companies/enrich-premium` | Company Premium | Company Base plus headcount, growth, turnover, and workforce breakdowns |

A call is charged only when it returns a match. The credit cost of each capability is shown on the Data Legion listing in your Firecrawl dashboard.

## Inputs

The `options` object takes the same fields as the Data Legion enrich endpoints.

Person capabilities take `email`, `email_hash`, `phone`, `social_url`, or a name (`full_name`, or `first_name` and `last_name`) paired with one more detail such as `company`, `school`, `job_title`, or `city`. See the [Person Enrichment API reference](/docs/api-reference/person-enrichment) for every field.

Company capabilities take `domain`, `name`, `linkedin_id`, or `ticker_symbol`. See the [Company Enrichment API reference](/docs/api-reference/company-enrichment) for every field.

## Calling a Capability

An Alexandria call is a Firecrawl `scrape` with an `alexandria` block instead of a URL.

<CodeGroup>
  ```python Python theme={null}
  import os

  from firecrawl import Firecrawl

  firecrawl = Firecrawl(api_key=os.environ["FIRECRAWL_API_KEY"])

  result = firecrawl.scrape(
      alexandria={
          "provider": "datalegion",
          "capability": "people/enrich-premium-no-contact",
          "options": {"social_url": "https://www.linkedin.com/in/janedoe"},
      },
  )

  entry = result.alexandria[0]
  ```

  ```javascript JavaScript theme={null}
  import Firecrawl from "@mendable/firecrawl-js";

  const firecrawl = new Firecrawl({ apiKey: process.env.FIRECRAWL_API_KEY });

  const result = await firecrawl.scrape({
    alexandria: {
      provider: "datalegion",
      capability: "people/enrich-premium-no-contact",
      options: { social_url: "https://www.linkedin.com/in/janedoe" },
    },
  });

  const entry = result.alexandria[0];
  ```
</CodeGroup>

For a company, change the capability and pass a company input, for example `"capability": "companies/enrich-base"` with `"options": {"domain": "hubspot.com"}`.

## Response

Each entry in `alexandria` has a `data` object with the standard Data Legion enrich response, plus the call's credit cost (`creditsCost` in JavaScript, `credits_cost` in Python):

```json theme={null}
{
  "matches": [
    {
      "person": {
        "full_name": "jane doe",
        "job_title": "senior product manager",
        "seniority_level": "senior",
        "company_name": "tech company",
        "linkedin_url": "https://www.linkedin.com/in/janedoe"
      },
      "match_metadata": {
        "matched_on": ["social_url"],
        "match_type": "exact",
        "match_confidence": "high"
      }
    }
  ],
  "total": 1
}
```

Company capabilities return `company` in place of `person`. Field definitions are in the [Person Schema](/docs/person-data/schema) and [Company Schema](/docs/company-data/schema).

A failed call returns an `error` object with a `code` and `message` instead of `data`. Check for it before reading the record.

## Accept the Data Terms

Alexandria requires each Firecrawl organization to accept a provider's data terms before calling it. Until an admin accepts them, requests fail with HTTP 403 and the code `THIRD_PARTY_DATA_TERMS_REQUIRED`, and the error's `requiresAction.url` points to where an admin accepts them. Both SDKs raise this as an exception (`ProviderTermsRequiredError` in Python), so it never reaches the per-call `error` object.

<Note>
  Firecrawl's guidance is that agents need explicit user authorization before accepting terms. Have a person accept them once in the Firecrawl dashboard rather than letting an agent do it.
</Note>

## Discovery

Agents don't need the capability names hardcoded. Firecrawl's `find_tools` (`findTools` in JavaScript), or a search request with `sources: ["alexandria"]`, returns matching providers with their capability paths, inputs, response contracts, and pricing. Discovery is free.

## Alexandria or the Data Legion API

Alexandria covers enrichment, one record per call, on your Firecrawl key and bill. Search, natural-language discovery, bulk delivery, and higher rate limits are on the [Data Legion API](/docs/api-reference/overview), which uses a Data Legion API key.

## Related

* [Person Enrichment API](/docs/api-reference/person-enrichment)
* [Company Enrichment API](/docs/api-reference/company-enrichment)
* [MCP Server](/docs/integrations/mcp-server) for connecting AI assistants directly
* [Firecrawl documentation](https://docs.firecrawl.dev)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.