Skip to main content

How to get TrueClicks data using the REST API

Use REST API to load TrueClicks data.

Written by Ales Sturala

Following the instructions below, you can load TrueClicks data through REST API.

Prerequisites

Before using the API, ensure you have a TrueClicks data connector key:

  1. Log in to TrueClicks and navigate to the Reporting page

  2. Scroll down to the Data Connector section

  3. Enter a key of your choice, and click the Create New Key

This process generates a Username and Token, which you’ll use later, for example, when integrating with Google Sheets, Looker Studio, or through REST API.

Accessing data with the REST API

TrueClicks data is available through our REST API. Every endpoint is a standard HTTPS GET request that returns JSON, so you can pull data into a spreadsheet, a BI tool, or your own scripts.

Example:

Available data sets in REST API

You can access the following datasets via REST API:

Data set

URL

Description

Accounts

The connected ad accounts in your environment, with their ID, name, and platform. Use the account ID here to filter the other endpoints.

Optional parameters: accountIdsFilter

Account-level results (current)

The latest audit and monitoring results aggregated per account, including the TrueClicks score, issue counts, and audit findings.

Optional parameters: accountIdsFilter

Account-level results (historical)

The same account-level results, with weekly history going back up to 1 year.

Optional parameters: accountIdsFilter

Check-level results (current)

The latest score or value for every individual audit and monitoring check, per account. Includes how much fixing each check would raise the account's TrueClicks score.

Optional parameters: accountIdsFilter

Check output table

The detailed rows behind a single check for one account (the entities the check flagged). Get the ruleKey from the check-level results endpoint above.

Required parameters: accountId, ruleKey

Performance monitoring alerts

Currently triggered performance alerts. Each row is a metric that breached its threshold or fluctuation limit in the latest run of an active alert definition, with the current and previous values, the change, and the campaigns involved.

Optional parameters: accountIdsFilter

Performance alert output table

The per-campaign metric rows behind a triggered performance alert. Get perfmonId and perfmonDefinitionMetricId from the performance monitoring alerts endpoint above.

Required parameters: accountId, perfmonId, perfmonDefinitionMetricId

Target and budget pacing (current)

Target and budget pacers that are currently running, with their pacing and efficiency status.

Optional parameters: accountIdsFilter

Target and budget pacing (all)

All target and budget pacers, including finished and future scheduled periods.

Optional parameters: accountIdsFilter

Users

Active users and pending invitations.

Users' My Accounts

One row per user for each account they've picked as a My Account. A personal preference list, not an access-permission list.

Optional parameters: accountIdsFilter

Tasks

All target and budget pacers, including finished and future scheduled periods.

Optional parameters: accountIdsFilter

Account labels

The labels applied to your accounts, for grouping and filtering.

Optional parameters: accountIdsFilter

Filtering results by account

Add accountIdsFilter to limit results to specific accounts. Repeat the parameter for each account you want, and leave it off to return all accounts you have access to.

Example:

Check-level output table results

Some checks have table outputs with extra detail rows. Use the check output table endpoint (audit-rule-output-table) to retrieve those.

Example:

  • Steps:

    1. Replace the accountId=123 in the URL with your actual account ID (visible in the TrueClicks interface URL)

    2. Open the updated URL in your browser

    3. If prompted, enter your data connector username and token as the credentials

    4. Retrieve the output table in JSON format for the specified account and check

Key Parameters:

  • accountId - your account’s unique ID, found in the TrueClicks interface URL

  • ruleKey: The internal key for TrueClicks checks

  • ruleKey parameter - there are 2 ways you can retrieve the internal key for TrueClicks checks:

    • Retrieve this from the REST API endpoint for check-level data (field: ruleKey).

    • Alternatively, convert the check name in the TrueClicks UI to camel-case format.
      Example: urgent-broken-asset-urlUrgent_BrokenAssetUrl.

OpenAPI specification (for developers)

If you're building an integration, the full API is described in a machine-readable OpenAPI specification. It lists every endpoint, its parameters, and its response schemas, so you can import it into your API client or code generator instead of wiring requests up by hand.

Specification URL:

Import it into a tool like Postman or an OpenAPI code generator to scaffold requests automatically. Authenticate with your data connector username and token over HTTP Basic auth, the same credentials used for the endpoints above.

Did this answer your question?