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

# Pinterest as a data source

> Bring data from Pinterest (API v5) to Nekt.

Pinterest is a visual discovery engine where users find ideas and inspiration. The connector uses the **Pinterest API v5** to extract user account, ad accounts, campaigns, ad groups, ads, and their analytics for advertising and reporting.

<img width="200" src="https://mintcdn.com/nekt/Nj-ickqfD6VtUkly/assets/logo/logo-pinterest.png?fit=max&auto=format&n=Nj-ickqfD6VtUkly&q=85&s=9cfb7e8c9d9922d7a2b25aa154566d63" data-path="assets/logo/logo-pinterest.png" />

## Configuring Pinterest as a Source

In the [Sources](https://app.nekt.ai/sources) tab, click on the "Add source" button located on the top right of your screen. Then, select the Pinterest option from the list of connectors.

Click **Next** and you'll be prompted to add your access.

### 1. Add account access

You'll need to authorize Nekt to access your Pinterest data via **OAuth 2.0**.

The following configurations are available:

* **Start date**: (Optional) Start date for analytics streams (YYYY-MM-DD). If omitted, last 30 days will be used(max. 90 days on API). **Note:** The Pinterest API only provides analytics for the last 90 days; older start dates are automatically capped.

* **Lookback window (days)**: (Optional, default: 7) Pinterest may update analytics data for recent days. Nekt re-fetches data within this window so the last N days are always up-to-date. Only applies to analytics streams.

Once you're done, click **Next**.

### 2. Select streams

Choose which data streams you want to sync. For faster extractions, select only the streams that are relevant to your analysis. You can select entire groups of streams or pick specific ones.

> Tip: The stream can be found more easily by typing its name.

Select the streams and click **Next**.

### 3. Configure data streams

Customize how you want your data to appear in your catalog. Select the desired layer where the data will be placed, a folder to organize it inside the layer, a name for each table (which will effectively contain the fetched data) and the type of sync.

* **Layer**: choose between the existing layers on your catalog. This is where you will find your new extracted tables as the extraction runs successfully.
* **Folder**: a folder can be created inside the selected layer to group all tables being created from this new data source.
* **Table name**: we suggest a name, but feel free to customize it. You have the option to add a **prefix** to all tables at once and make this process faster!
* **Sync Type**: you can choose between INCREMENTAL and FULL\_TABLE. All streams use full table sync by default.

Once you are done configuring, click **Next**.

### 4. Configure data source

Describe your data source for easy identification within your organization, not exceeding 140 characters.

To define your [Trigger](https://docs.nekt.com/get-started/core-concepts/triggers), consider how often you want data to be extracted from this source. This decision usually depends on how frequently you need the new table data updated (every day, once a week, or only at specific times).

Optionally, you can define some additional settings:

* Configure Delta Log Retention and determine for how long we should store old states of this table as it gets updated. Read more about this resource [here](https://docs.nekt.com/get-started/core-concepts/resource-control).
* Determine when to execute an **Additional [Full Sync](https://docs.nekt.com/get-started/core-concepts/types-of-sync#additional-full-sync)**. This will complement the incremental data extractions, ensuring that your data is completely synchronized with your source every once in a while.

Once you are ready, click **Next** to finalize the setup.

### 5. Check your new source

You can view your new source on the [Sources](https://app.nekt.ai/sources) page. If needed, manually trigger the source extraction by clicking on the arrow button. Once executed, your data will appear in your Catalog.

<Warning>For you to be able to see it on your [Catalog](https://app.nekt.ai/catalog), you need at least one successful source run.</Warning>

# Streams and Fields

Below you'll find all available data streams from Pinterest (API v5) and their corresponding fields. Streams such as **campaigns**, **ad\_groups**, and **ads** (and their analytics) depend on **ad\_accounts** and are synced per ad account.

<AccordionGroup>
  <Accordion title="user_account">
    | Field           | Type   | Description                  |
    | --------------- | ------ | ---------------------------- |
    | `id`            | String | User account ID              |
    | `username`      | String | Username                     |
    | `account_type`  | String | Account type (e.g. BUSINESS) |
    | `profile_image` | String | Profile image URL            |
    | `website_url`   | String | Website URL                  |
    | `business_name` | String | Business name                |
    | `business_id`   | String | Business ID                  |
    | `about`         | String | About/bio                    |
  </Accordion>

  <Accordion title="user_account_analytics">
    | Field         | Type   | Description                                                                                                          |
    | ------------- | ------ | -------------------------------------------------------------------------------------------------------------------- |
    | `date`        | String | Date (YYYY-MM-DD) for daily metrics                                                                                  |
    | `data_status` | String | Data status                                                                                                          |
    | `metrics`     | String | JSON string containing metric blocks (e.g. summary\_metrics, daily\_metrics with ENGAGEMENT, IMPRESSION, SAVE, etc.) |
  </Accordion>

  <Accordion title="ad_accounts">
    | Field          | Type   | Description                                  |
    | -------------- | ------ | -------------------------------------------- |
    | `id`           | String | Ad account ID (e.g. act\_123)                |
    | `name`         | String | Ad account name                              |
    | `owner`        | Object | Object with `id` and `username` (owner user) |
    | `country`      | String | Country code                                 |
    | `currency`     | String | Currency code                                |
    | `permissions`  | Array  | Permission scopes for the ad account         |
    | `created_time` | Number | Unix timestamp                               |
    | `updated_time` | Number | Unix timestamp                               |
  </Accordion>

  <Accordion title="ad_account_analytics">
    | Field           | Type   | Description                                               |
    | --------------- | ------ | --------------------------------------------------------- |
    | `ad_account_id` | String | Ad account ID (from context)                              |
    | `date`          | String | Date (YYYY-MM-DD)                                         |
    | Various metrics | Number | Metrics (spend, impressions, etc.) as returned by the API |
  </Accordion>

  <Accordion title="campaigns">
    | Field            | Type   | Description                  |
    | ---------------- | ------ | ---------------------------- |
    | `ad_account_id`  | String | Ad account ID (from context) |
    | `id`             | String | Campaign ID                  |
    | `name`           | String | Campaign name                |
    | `status`         | String | Status (e.g. ACTIVE, PAUSED) |
    | `objective_type` | String | Objective type               |
    | `created_time`   | Number | Unix timestamp               |
    | `updated_time`   | Number | Unix timestamp               |
  </Accordion>

  <Accordion title="campaigns_analytics">
    | Field           | Type   | Description                        |
    | --------------- | ------ | ---------------------------------- |
    | `ad_account_id` | String | Ad account ID (from context)       |
    | `date`          | String | Date (YYYY-MM-DD)                  |
    | `campaign_id`   | String | Campaign ID                        |
    | Various metrics | Number | Metrics (spend, impressions, etc.) |
  </Accordion>

  <Accordion title="ad_groups">
    | Field           | Type   | Description                  |
    | --------------- | ------ | ---------------------------- |
    | `ad_account_id` | String | Ad account ID (from context) |
    | `id`            | String | Ad group ID                  |
    | `name`          | String | Ad group name                |
    | `campaign_id`   | String | Campaign ID                  |
    | `status`        | String | Status                       |
    | `created_time`  | Number | Unix timestamp               |
    | `updated_time`  | Number | Unix timestamp               |
  </Accordion>

  <Accordion title="ad_groups_analytics">
    | Field           | Type   | Description                        |
    | --------------- | ------ | ---------------------------------- |
    | `ad_account_id` | String | Ad account ID (from context)       |
    | `date`          | String | Date (YYYY-MM-DD)                  |
    | `ad_group_id`   | String | Ad group ID                        |
    | Various metrics | Number | Metrics (spend, impressions, etc.) |
  </Accordion>

  <Accordion title="ads">
    | Field           | Type   | Description                  |
    | --------------- | ------ | ---------------------------- |
    | `ad_account_id` | String | Ad account ID (from context) |
    | `id`            | String | Ad ID                        |
    | `name`          | String | Ad name                      |
    | `ad_group_id`   | String | Ad group ID                  |
    | `campaign_id`   | String | Campaign ID                  |
    | `status`        | String | Status                       |
    | `created_time`  | Number | Unix timestamp               |
    | `updated_time`  | Number | Unix timestamp               |
  </Accordion>

  <Accordion title="ads_analytics">
    | Field           | Type   | Description                        |
    | --------------- | ------ | ---------------------------------- |
    | `ad_account_id` | String | Ad account ID (from context)       |
    | `date`          | String | Date (YYYY-MM-DD)                  |
    | `ad_id`         | String | Ad ID                              |
    | Various metrics | Number | Metrics (spend, impressions, etc.) |
  </Accordion>
</AccordionGroup>

# Data Model

The following diagram illustrates the main relationships between streams. **ad\_accounts** is the parent for campaigns, ad\_groups, ads and all analytics streams that are scoped per ad account.

```mermaid theme={null}
erDiagram
    ad_accounts ||--o{ campaigns : "ad_account_id"
    ad_accounts ||--o{ ad_groups : "ad_account_id"
    ad_accounts ||--o{ ads : "ad_account_id"
    ad_accounts ||--o{ ad_account_analytics : "ad_account_id"
    ad_accounts ||--o{ campaigns_analytics : "ad_account_id"
    ad_accounts ||--o{ ad_groups_analytics : "ad_account_id"
    ad_accounts ||--o{ ads_analytics : "ad_account_id"

    ad_accounts {
        string id PK
        string name
        object owner
        string country
        string currency
    }

    campaigns {
        string ad_account_id
        string id PK
        string name
        string status
    }

    ad_groups {
        string ad_account_id
        string id PK
        string campaign_id
    }

    ads {
        string ad_account_id
        string id PK
        string ad_group_id
        string campaign_id
    }
```

# Implementation Notes

* **Authentication**: Once you authorize your account, Nekt will handle generating and refreshing the short-lived access tokens automatically.
* **Analytics date range**: Analytics streams use the **Start date** config (or last 30 days if omitted) up to today. **90-day limit:** The Pinterest API does not provide analytics data older than 90 days; this is an API limitation and cannot be worked around (e.g. by chunking requests). If you set a start date older than 90 days, the connector will request from (today − 90 days) to today. **Lookback window** (default 7 days): Nekt re-fetches the last N days on each run so recently changing metrics stay up-to-date.
* **Parent streams**: **campaigns**, **ad\_groups**, **ads**, and all \*\_analytics streams depend on **ad\_accounts**. Ensure **ad\_accounts** is selected when syncing these streams.
* **Pagination**: List streams (ad\_accounts, campaigns, ad\_groups, ads) use Pinterest v5 bookmark pagination (page\_size and bookmark cursor).

## Skills for agents

<Snippet file="agent-skills-intro.mdx" />

<Card title="Download Pinterest skills file" icon="wand-magic-sparkles" href="/sources/pinterest.md">
  Pinterest connector documentation as plain markdown, for use in AI agent contexts.
</Card>
