Get Your Data Builder Table Data Into Your Own Code

Get Your Data Builder Table Data Into Your Own Code

Info
You built a data table in Data Builder and want its rows in your own script, warehouse, or scheduled job. This guide covers the two ways to do that and helps you pick the right one. The short version: the Power My Analytics API has no Data Builder endpoint, so use the MCP server to read a table you already built, or use the API to query the raw connector data yourself.

Before you start

  • A data table already built in Data Builder (see the Data Builder Guide).
  • A PMA API key, created under Tools > API in your Hub. The same key works for both paths in this article.
Notes
If Tools > API shows a "Contact Sales for Custom Plan" card instead of the key tools, API access is not enabled on your plan yet. See Get Started with Power My Analytics API.

Which path is yours

You want to...
Use
Why
Pull the rows of a table you already built in Data Builder, on a schedule
MCP server
It reads your existing datasets and tables directly, so there is no rebuilding.
Blend across sources and hand the result to your own code or a BI tool
MCP server
Your blend logic already lives in the table.
Query raw connector data and shape it yourself in code
API
Gives you per-connector reports, fields, and date ranges.


The API and the MCP server read the same warehoused data; neither one is newer or better. They are different doors to the same rooms.

Option 1: Read your Data Builder data through the MCP server

The MCP server has a headless mode, which means your server sends your API key as a Bearer token and there is no browser sign-in step. That is what you want for a job that runs on a schedule.

  1. Open your Hub and go to Tools > API.
  2. Click + Create API Key and copy the key.
  3. Point your MCP client at https://pma-mcp.web.app/mcp and send the header Authorization: Bearer YOUR_API_KEY.
  4. Call pma_list_datasets to find your dataset and see the data tables inside it.
  5. Get your rows:
    • For a specific data table, call pma_get_data_table_data with that table. This returns the table whole, including a blended table that combines several sources.
    • For the combined result across every table in a dataset, call pma_get_dataset_data with the dataset and a date range.

Full walkthrough with working Node.js code: Headless/Server-to-Server Integration with PMA MCP Server.

Other Data Builder calls available over MCP

  • pma_get_dataset: the structure of one dataset and the fields each table pulls.
  • pma_add_data_table: adds a data table to an existing dataset.
  • pma_create_dataset: creates a dataset, blank or from a template.
  • pma_list_dataset_templates: the pre-built dataset recipes.

Anything you create this way is the same dataset you see in the Hub under Data Builder. You can edit it in either place.

Does my API key expire?

The API key you generate under Tools > API does not expire on its own. Rotate it from the Hub whenever you would rotate any production secret (when someone leaves, when you suspect it has leaked, or when your policy calls for it), then update it in your secret store and restart your service. (Keys minted by the browser sign-in flow are different; those expire one year after they are issued.)

Option 2: Rebuild the query with the API

If you would rather work against the connector layer, you rebuild what your table does. It takes four calls:

  1. Get your account IDs. GET /http-organizations/{organizationId}/accounts/{providerType}. Your organization ID is in your Hub URL: hub.powermyanalytics.com/organizations/[organization ID]/overview. The provider type is a string such as facebook_ads; GET /http-connectors lists them all.
  2. Get the config that connector expects. GET /connectors-{connectorType}-config. Use dashes, not underscores, in connectorType (for example, facebook-ads).
  3. Get the field names. GET /connectors-{connectorType}-schema
  4. Get the report. GET /connectors-{connectorType}-report with your config, start, end, fields, and aggregate.

Send the config payload as URI-encoded JSON. Full reference: SwaggerHub PMA-V4 2.0.0.

Need LinkedIn Ads, LinkedIn Companies, or X Ads?

These three connectors have not moved to the current protocol yet. Structure those calls against the legacy API documentation instead.

Where to find the account IDs your table uses

In Data Builder, add the Account ID field to your report and run it. The values it returns are what you pass to the API.

What you will see in your results

The MCP path returns the same rows you see when you preview the table in Data Builder: same fields, same order, same date-range logic. pma_get_data_table_data returns one data table whole, including a blended table that combines several sources. pma_get_dataset_data returns the combined result across every table in a dataset.

The API path returns raw connector rows. If your table blended several sources, you will get one response per connector and you do the joining in your own code (or let Data Builder do the blending and read the finished table through the MCP path instead).

Still stuck?

Submit a ticket with your organization ID and the name of the data table you are trying to reach, and we will send you the exact call.

    • Related Articles

    • Get AI Insights in Data Builder

      Power My Analytics now offers AI Insights for intelligent analysis of your datasets and data tables in our Data Builder. With AI Insights, you can identify performance trends in your report data and find strategies for success in your campaigns, ...
    • Error: 'Unable to get live data for this component' in Amazon Seller Sales and Traffic by ASIN Report

      This article will help to resolve the following problem: when pulling data from the Amazon Seller Central Sales and Traffic by ASIN report into Data Studio, Data Builder, Google Sheets, Microsoft Excel, or any other Power My Analytics reporting ...
    • Data Builder Guide

      If you've ever spent hours rebuilding the same report for different clients or struggled to blend data from multiple ad platforms, Data Builder solves these exact challenges. It handles all the data preparation - organizing sources, selecting fields, ...
    • Report Data in Power BI

      Power My Analytics offers a native Power BI connector that allows you to load your Data Builder datasets directly into Power BI Desktop for custom reports and dashboards. This guide walks you through connecting your PMA hub to Power BI, installing ...
    • Everflow Data Connector User Guide

      Get valuable insights into your affiliate and partner marketing performance by connecting your Everflow account to Power My Analytics. This guide will walk you through setup, reporting capabilities, and important considerations. Prerequisites Before ...