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

# Quickstart

> Get started with the Sacra API in minutes

## Get your API key

Before making requests you need an organization API token. If you don't have a Sacra account yet, [sign up](https://sacra.com/signup/) to get started.

<AccordionGroup>
  <Accordion icon="key" title="Create an API token">
    1. Sign in to [Sacra](https://sacra.com/login) and navigate to your organization settings.
    2. Go to **API Keys** and click **Create API Key**.
    3. Give the key a name (e.g. `my-app`) and copy the token — you won't be able to see it again.
  </Accordion>

  <Accordion icon="lock" title="Authenticate your requests">
    Pass the token in the `Authorization` header on every request:

    ```bash theme={null}
    curl -H "Authorization: Token YOUR_API_KEY" \
      "https://sacra.com/api/v1/companies/?company_domain=stripe.com"
    ```

    A successful response confirms your token is valid:

    ```json theme={null}
    {
      "company": {
        "domain": "stripe.com",
        "name": "Stripe",
        "slug": "stripe"
      }
    }
    ```
  </Accordion>
</AccordionGroup>

## Make your first request

<AccordionGroup>
  <Accordion icon="building" title="Look up a company">
    Fetch company data by domain:

    ```bash theme={null}
    curl -H "Authorization: Token YOUR_API_KEY" \
      "https://sacra.com/api/v1/companies/?company_domain=stripe.com"
    ```
  </Accordion>

  <Accordion icon="file-lines" title="List documents for a company">
    Get the latest research documents for a company:

    ```bash theme={null}
    curl -H "Authorization: Token YOUR_API_KEY" \
      "https://sacra.com/api/v1/documents/?company_domain=stripe.com"
    ```

    <Tip>Use `page_after` and `page_before` cursors from the `pagination` object to page through results.</Tip>
  </Accordion>

  <Accordion icon="magnifying-glass" title="Search across all content">
    Search documents and companies by keyword:

    ```bash theme={null}
    curl -X POST \
      -H "Authorization: Token YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"query": "fintech revenue"}' \
      https://sacra.com/api/v1/search/
    ```
  </Accordion>
</AccordionGroup>

## Core concepts

<CardGroup cols={2}>
  <Card title="Companies" icon="building" href="/api-reference/companies/list-companies">
    Look up companies by domain, slug, or ID. Returns financials, milestones, and metadata.
  </Card>

  <Card title="Documents" icon="file-lines" href="/api-reference/documents/list-documents">
    Browse market research, company one-pagers, and interview transcripts.
  </Card>

  <Card title="Search" icon="magnifying-glass" href="/api-reference/documents/search">
    Full-text search across all documents and companies.
  </Card>

  <Card title="Events & Metrics" icon="chart-line" href="/api-reference/events/get-aggregated-events">
    Access company events and financial metrics.
  </Card>
</CardGroup>

## Pagination

Most list endpoints return paginated results. The `pagination` object in each response tells you how to fetch the next page.

**Cursor-based** (documents, events, metrics, news):

```json theme={null}
{
  "pagination": {
    "page_size": 30,
    "total_items": 142,
    "next_link": "https://sacra.com/api/v1/documents/?page_after=abc123"
  }
}
```

**Offset-based** (search, category items):

```json theme={null}
{
  "pagination": {
    "limit": 20,
    "offset": 0,
    "total": 85,
    "next_offset": 20
  }
}
```

<Tip>Follow the `next_link` URL directly — it includes all the query parameters you need.</Tip>

## Next steps

<CardGroup cols={2}>
  <Card title="API reference" icon="code" href="/api-reference">
    Explore the full API reference with request and response schemas.
  </Card>

  <Card title="Display company data" icon="browser" href="/guides/display-company-data">
    Embed company data, charts, and research documents into your site.
  </Card>

  <Card title="Revenue" icon="book" href="/concepts/revenue">
    Understand revenue data types, datapoint periods, and how to interpret financial data.
  </Card>

  <Card title="MCP server" icon="plug" href="/mcp-server">
    Connect to the Sacra MCP server for AI agent integration.
  </Card>
</CardGroup>
