# Get Report — TikTok Ads Manager

> Run a synchronous report to retrieve performance metrics for campaigns, ad groups, or ads. report_type is required. advertiser_id is required for BASIC, AUDIENCE, PLAYABLE_MATERIAL, CATALOG, and TT_SHOP reports; use bc_id for BC reports…

- Key: `tiktok_ads_manager-get-report`
- Type: Action (Read-only)
- Version: 0.0.2
- App: TikTok Ads Manager (`tiktok_ads_manager`) — https://pipedream.com/apps/tiktok-ads-manager.md
- This page (HTML): https://pipedream.com/apps/tiktok-ads-manager/actions/get-report
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/tiktok_ads_manager/actions/get-report/get-report.mjs

## Description

Run a synchronous report to retrieve performance metrics for campaigns, ad groups, or ads. `report_type` is required. `advertiser_id` is required for BASIC, AUDIENCE, PLAYABLE_MATERIAL, CATALOG, and TT_SHOP reports; use `bc_id` for BC reports. `data_level` is required for BASIC, AUDIENCE, and CATALOG reports. `start_date` and `end_date` are required unless `query_lifetime` is true. `dimensions` must include an entity ID dimension for the chosen level (`campaign_id`, `adgroup_id`, or `ad_id`) plus a time dimension (`stat_time_day` or `stat_time_hour`). Common metrics: `impressions`, `clicks`, `spend`, `cpc`, `cpm`, `ctr`, `reach`, `conversion`, `cost_per_conversion`. [See the documentation](https://business-api.tiktok.com/portal/docs/run-a-synchronous-report/v1.3)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `advertiserId` | `string` | No | Required for BASIC, AUDIENCE, PLAYABLE_MATERIAL, CATALOG, and TT_SHOP reports. Not used for BC reports — use bc_id instead. |
| `bcId` | `string` | No | Required when report_type is BC. ID of the Business Center to report on. Use /bc/get/ to find your Business Center IDs. |
| `reportType` | `string` | Yes | BASIC is the standard performance report. AUDIENCE breaks down by audience attributes. BC reports on a Business Center (requires bc_id). |
| `dataLevel` | `string` | No | Granularity of the report. Required for BASIC, AUDIENCE, and CATALOG reports. AUCTION_CAMPAIGN = campaign level, AUCTION_ADGROUP = ad group level, AUCTION_AD = ad level, AUCTION_ADVERTISER = advertiser level. |
| `dimensions` | `string[]` | Yes | Required. Dimensions to group by. Include the entity ID for the chosen data_level (campaign_id, adgroup_id, or ad_id) plus a time dimension (stat_time_day). Example: ["campaign_id", "stat_time_day"]. |
| `metrics` | `string[]` | No | Metrics to return. Example: ["impressions", "clicks", "spend", "cpc", "ctr"]. |
| `startDate` | `string` | No | Report start date in YYYY-MM-DD format. Required unless query_lifetime is true. Max range is 30 days when stat_time_day is in dimensions, 365 days otherwise. |
| `endDate` | `string` | No | Report end date in YYYY-MM-DD format. Required unless query_lifetime is true. |
| `queryLifetime` | `boolean` | No | If true, returns lifetime metrics and ignores start_date/end_date. Only supported for BASIC and PLAYABLE_MATERIAL report types. |
| `serviceType` | `string` | No | Ad service type. Not used for BC reports. Default is AUCTION. |
| `filtering` | `string` | No | JSON array of filter objects, each with field_name, filter_type, and filter_value. Example: [{"field_name":"campaign_ids","filter_type":"IN","filter_value":"[\"123\"]"}]. |
| `orderField` | `string` | No | Metric to sort results by. All supported metrics (excluding attribute metrics) can be used. |
| `orderType` | `string` | No | Sort direction. Default is DESC. |
| `page` | `integer` | No | Page number for paginated results. Starts at 1. |
| `pageSize` | `integer` | No | Number of results per page. Default: 10, max: 1000. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "tiktok_ads_manager",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "tiktok_ads_manager-get-report",
  arguments: {
    advertiserId: "Advertiser ID",
    bcId: "Business Center ID",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "tiktok_ads_manager-get-report",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    tiktok_ads_manager: { authProvisionId: "apn_xxxxxxx" },
    advertiserId: "Advertiser ID",
    bcId: "Business Center ID",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "tiktok_ads_manager-get-report",
    "configured_props": {
      "tiktok_ads_manager": { "authProvisionId": "apn_xxxxxxx" },
      "advertiserId": "Advertiser ID",
      "bcId": "Business Center ID"
    }
  }'
```

---

- App: https://pipedream.com/apps/tiktok-ads-manager.md · All apps: https://pipedream.com/apps
