The DatAds Public API is a REST API that lets your code read and change a client's data in DatAds: ads, performance, reports, inspiration and Blink. The full API reference with every endpoint is at public.api.datads.io/docs.
Who can use this
Plans: Regular and Custom, the legacy Plus and Pro plans, and the free trial. Not available on Lite and the legacy Starter plan.
Roles: A workspace Admin creates the API key, with the permission Read or Read & write. Anyone who has the key can use the Public API for that key's client.
Platforms: Meta, TikTok, Google Ads
Why the Public API matters
The Public API brings your DatAds data into the systems you already use. Data teams use it to fill business intelligence (BI) tools, internal dashboards and spreadsheets. Developers use it for scripts that run without anyone opening DatAds.
The Public API returns the data that DatAds adds to your ads, such as AI tags, visual descriptions and transcripts. This lets your own analysis group ads by what they show and say, not only by their names.
Public API or MCP server: which one to use
The Public API is for code you write: scripts, data pipelines and BI tools. The DatAds MCP server is for AI tools such as Claude and ChatGPT, which use DatAds while you chat with them.
API keys work only with the Public API. The MCP server doesn't use API keys: you sign in with your DatAds account, and the AI tool sees the clients you can see. See What the DatAds MCP server is and MCP server, Blink and connectors: which one to use.
How the Public API works
Every Public API request goes to the base URL https://public.api.datads.io. All paths start with /v1, for example https://public.api.datads.io/v1/ad-accounts?pageNumber=1&pageSize=50.
Each request must send an API key in the X-API-Key header. Without a valid key, the Public API answers with status 401 and the message "Not authenticated." To create a key, see Create and manage API keys.
A Public API key belongs to one client. Every request works on that client, so requests have no client parameter. To work with several clients, create one key in each client. A key created in All Clients reads every ad account of the workspace.
The Public API answers in JSON. Long lists come in pages: you choose the page with pageNumber and the number of items per page with pageSize.
What you can do with the Public API
The Public API covers these areas of a client:
Ads and their structure: ad accounts, campaigns, ad groups and ads, with AI tags, visual descriptions and transcripts. You can search ads by what they show, or filter them by any field, including AI tags.
Performance: metrics as totals, as daily trends or broken down by a dimension, exports per day, week or month, and benchmarks for your account and your industry.
Reports: your saved Top Performing, Comparative Analysis, Recently Launched and Testing Log reports, with their results and settings.
Inspiration: the Discovery ad library, brands and their ad mix, and the client's Inspiration Boards.
Blink: projects, products, the Brain's Brand Memory and Brand Context with their history, Blink chats, automations and their runs, and the list of Blink AI connectors.
For every endpoint, with its fields and examples, see the API reference at public.api.datads.io/docs.
Make changes with the Public API
Every API key can read. To make changes, the key needs the permission Read & write. With a Read & write key, your code can also:
Reports: create reports, change their settings, move them to the Bin and restore them.
Inspiration Boards: create and change boards, save and remove ads, move boards to the Bin and restore them.
Discover: follow brands and mark competitors.
Projects: create Blink projects and change their name, instructions and products.
Brain: change the Brand Context and Brand Memory, and restore an earlier version from their history.
Blink chats: start a chat, send a follow-up, ask Blink to answer again, stop an answer and delete a chat.
Automations: create, change, delete and run Blink automations.
A Read key that tries to make a change gets status 403 and the message "Not authorized." To create a Read & write key, see Create and manage API keys.
Changes act as the person who created the API key. That person must still be an Admin, or a Member with access to the client. If the person has left, create a new key. Report histories and Brain histories show each change with the source API and the name of the key.
Blink chats and automation runs started through the Public API use AI credits of the workspace, like chats in DatAds.
Rate limits of the Public API
The Public API limits how many requests one API key can send. Each endpoint belongs to an endpoint group, and all endpoints of a group share one counter per API key. The API reference shows the group of each endpoint.
This table lists the Public API limits for each kind of request:
Kind of request | Endpoint groups | Limit per API key |
Read | Ad accounts, campaigns, ad groups, ads, AI tags, metrics, industries, saved reports and report settings, Inspiration Boards, Discovery brand search, projects, products, connectors, Brain, chats, automations | 50 requests per minute |
Search | Ad search, the ads of an Inspiration Board | 10 requests per minute, 300 per hour, 4,000 per day |
Calculate | Insights, exports, benchmarks, report results, Testing Log comparison cells, the Discovery ad library, brand breakdowns | 5 requests per minute, 150 per hour, 2,000 per day |
Change | Reports (write), Inspiration Boards (write), Discover (write), Projects (write), Chats (write): stop an answer and delete a chat, Automations (write) | 10 requests per minute, 300 per hour, 4,000 per day |
Blink and Brain changes | Chats (turns): start a chat, send a message, answer again; Brain (write): change or restore the Brand Context or Brand Memory | 5 requests per minute, 150 per hour, 2,000 per day |
In addition, all Public API requests from one IP address share a limit of 50 requests per second.
When a request goes over a limit, the Public API answers with status 429. The message names the endpoint group, the limit and when to retry, for example: "Too many requests per minute for the endpoint group Insights. Limit is 5 requests per minute. Retry after up to one minute when this window resets." Wait until the window resets, then send the request again.
Errors from the Public API
Every Public API error has an HTTP status and a JSON body with a code and a message, for example {"code": "019d90a2-dae9-73db-bf83-5f8deac4f2fc", "message": "Not authenticated."}. The message says what is wrong. The code identifies the exact error, so include it when you contact support.
This table lists the Public API error statuses and what to do:
Status | What it means | What to do |
400 | The request has invalid input, for example a missing field, a wrong value or "Invalid JSON in request body". The message names the problem. | Correct the request and send it again. |
401 | "Not authenticated." The X-API-Key header is missing, the key is mistyped, or the key was revoked or has expired. | Check the header and the key. If the key was revoked or has expired, create a new one. |
403 | The key can't make this request, for example "Not authorized." (a Read key tried to make a change), "Only users who can edit this client can …" (the key's creator has no edit access to the client), "This feature is not available on your plan. Please upgrade your plan.", "Subscription expired. Please renew your plan." or "You have used all available credits. Purchase a credit pack or wait for your next billing period." | Read the message. For "Not authorized." on a change, use a Read & write key. For an edit-access message, an Admin gives the key's creator edit access to the client, or creates a new key. For a plan or subscription message, an Admin upgrades or renews the plan in Settings > Billing. For the credit message, an Admin buys a credit pack. |
404 | The item doesn't exist, or it belongs to another client. An unknown path answers "Not found". | Check the ID and the path, and that the key belongs to the right client. |
409 | The change conflicts with the current state, for example "Blink is still answering in this chat.", "This automation is already running. Wait for the run to finish." or "A client can have at most 50 automations. Delete one first." | Follow the message: wait until Blink's answer or the run is finished, or stop the answer first, then send the request again. |
429 | The request went over a rate limit. | Wait until the window in the message resets, then retry. |
500 | "Internal server error" or "An unknown error occurred". | Retry once. If it fails again, contact support with the code. |
503 | The service is not available at the moment. | Send the request again later. If it keeps failing, contact support with the code. |
Versions of the Public API
The Public API has one version, v1. Every path starts with /v1, and there is no version header.
Plans for the Public API
The Public API is part of the Regular and Custom plans, the legacy Plus and Pro plans, and the free trial. It isn't available on Lite and the legacy Starter plan. Creating or revoking an API key needs an active subscription.
Blink chats and automations through the Public API answer with status 403 and "This feature is not available on your plan. Please upgrade your plan." when the workspace's plan doesn't include Blink. See Compare plans.
Blink chats in the Public API
The Public API lists and reads the Blink chats of the key's client, including the chats that automation runs create. Each chat comes with its messages and files. File links expire after 15 minutes: request the chat again to get new links. With a Read & write key, your code can also start and continue Blink chats.
To work with Blink from outside DatAds, see Use Blink from Claude, ChatGPT or the Public API. To learn what Blink does, see What Blink can and can't do.
Webhooks and the Public API
The Public API has no webhooks: DatAds doesn't send events to your systems. To get new data, your code asks the Public API, for example on a schedule.
