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

# Introduction

> End-to-end recipes for recreating the Profound dashboards with the public API.

The Cookbook is a collection of **end-to-end recipes** that show how to recreate
each chart, KPI, and table you see in the Profound app using only public API
calls. Every recipe is self-contained: it lists the exact endpoints used,
explains the request shape, and shows runnable Python and `curl` you can copy
into your own code.

If you just need the endpoint reference (every parameter, every metric), see
the [REST API](/rest-api/introduction) tab. The Cookbook is the layer above
that — common things people want to **build** with the API.

## Give your AI assistant context

Building with Claude, ChatGPT, Cursor, or another AI coding assistant?
Paste this URL — it's a compact index of every page in these docs that
your assistant can fetch on demand:

```
https://docs.tryprofound.com/llms.txt
```

## What you'll need

<Steps>
  <Step title="An API key">
    Generate one in **Settings → API Keys** in the Profound app. See
    [Authentication](/rest-api/authentication) if you don't have one yet.
  </Step>

  <Step title="A category ID">
    Every report query is scoped to a category. See
    [Find your category ID](/cookbook/setup/find-your-category-id) to
    look one up by name.
  </Step>

  <Step title="The Python SDK (optional)">
    The recipes default to the Python SDK because it's the most common path.
    Install with `pip install profound`. Every recipe also has a `curl` tab
    if you'd rather hit the REST API directly.
  </Step>
</Steps>

## One-time setup

Every recipe starts by constructing a client like this — you only need it
once per script, even if you're chaining several recipes:

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

  client = Profound(api_key=os.environ["PROFOUND_API_KEY"])
  ```

  ```bash curl theme={null}
  export PROFOUND_API_KEY=your_api_key_here
  ```
</CodeGroup>

## Conventions used in every recipe

Three things to internalize before you start — these come up in every recipe
and trip up most new users:

<AccordionGroup>
  <Accordion title="end_date is exclusive — bump it by one day" icon="calendar">
    The API parses `end_date` at the start of day, so it **excludes** the date
    you send. To include all of `2026-05-10`, send `end_date="2026-05-11"`.

    Display the inclusive value to your users; send `+1 day` to the API.
  </Accordion>

  <Accordion title="Read array positions from info.query, not the request order" icon="list-ol">
    Every response includes `info.query.metrics` and `info.query.dimensions`,
    which echo back the exact order the API used when packing each row's
    `metrics` and `dimensions` arrays.

    ```python theme={null}
    order = res.info.query["metrics"]   # e.g. ["visibility_score"]
    i = order.index("visibility_score")
    score = res.data[0].metrics[i]
    ```

    Don't hardcode positions. The order may not match the order you requested.
  </Accordion>

  <Accordion title="The API doesn't compute deltas — you do" icon="arrow-up-right">
    Period-over-period changes (the green/red `+1.0 pp` you see on every KPI
    tile) are computed client-side. Run the same call twice — once for the
    current window, once for the previous window of equal length — and diff
    the two scores in your code.
  </Accordion>
</AccordionGroup>

## Before you build

<CardGroup cols={2}>
  <Card title="Conventions & gotchas" icon="list-check" href="/cookbook/setup/conventions">
    Rate limits, exclusive end-dates, `info.query` ordering, errors,
    pagination. Read this once, paste into your AI assistant.
  </Card>

  <Card title="Data model" icon="sitemap" href="/cookbook/setup/data-model">
    How Categories, Topics, Prompts, Tags, Assets, and Personas relate.
  </Card>

  <Card title="Endpoints at a glance" icon="table" href="/cookbook/setup/endpoints-at-a-glance">
    Every endpoint, its metrics/dimensions, and what it's for — one
    scannable page.
  </Card>
</CardGroup>

## Recipes

### Setup

<CardGroup cols={2}>
  <Card title="Find your category ID" icon="magnifying-glass" href="/cookbook/setup/find-your-category-id">
    List the categories your key can see and pick one programmatically.
  </Card>

  <Card title="List your owned assets" icon="house-flag" href="/cookbook/setup/list-owned-assets">
    Get every asset in a category with its `is_owned` flag and domains.
  </Card>
</CardGroup>

### Visibility

<CardGroup cols={2}>
  <Card title="Visibility Score for one asset" icon="chart-simple" href="/cookbook/visibility/asset-visibility-score">
    An asset's score for the window plus the change vs the prior window.
  </Card>

  <Card title="Visibility over time" icon="chart-line" href="/cookbook/visibility/visibility-over-time">
    Build the daily / weekly / monthly line chart for an asset.
  </Card>

  <Card title="Headline and daily, together" icon="layer-group" href="/cookbook/visibility/headline-and-daily">
    Fetch both at once. Understand why they're different calls.
  </Card>

  <Card title="Top-N leaderboard" icon="trophy" href="/cookbook/visibility/leaderboard">
    Rank every asset in a category by any visibility metric.
  </Card>

  <Card title="Compare to competitors" icon="users" href="/cookbook/visibility/compare-competitors">
    Multi-line chart of any hand-picked set of assets.
  </Card>

  <Card title="Segment by model / region / persona" icon="filter" href="/cookbook/visibility/segment-by-model">
    Break a single asset's score down by the AI surface that answered.
  </Card>
</CardGroup>

### Citations

<CardGroup cols={2}>
  <Card title="Citation Share + delta" icon="percent" href="/cookbook/citations/citation-share">
    Owned-domain share of all citations, with the period-over-period change.
  </Card>

  <Card title="Citation Share and volume over time" icon="chart-line" href="/cookbook/citations/citation-share-over-time">
    Daily owned-domain share line **and** daily total citation volume,
    both from one call.
  </Card>

  <Card title="Citation Rank by domain" icon="trophy" href="/cookbook/citations/top-citing-domains">
    Every cited domain ranked by share, with the per-row pp delta column.
  </Card>
</CardGroup>
