Custom API connections

Getting programmatic access to your data

For most customers looking to download data, we recommend Downloading Consolidated Data in the reporting section, and for user-level data to request bulk report outputs from your account manager.

This document outlines how to connect to the AdLibertas dashboard via API. The connection is through our business analytics tool Metabase. Data exports from both user-level reporting and consolidated revenue reporting are available to export via API.

For simplicity's sake, we recommend using an authenticated post request to download saved questions. If you want/need the ability to create dynamic questions for API export, this is significantly more difficult and will require you to contruct the queries with each post. If you'd like assistance, please let us know.

Note for Consolidated Revenue Reporting: AdLibertas is constantly re-pulling network data to ensure we capture any changes or problems as reported by your data sources. Additionally, there are frequently data delays and outages that may lead to data being unavailable at the time of your request. For this reason we recommend you pull the trailing 7-15 days of data to account for any corrections we find.

Authentication:

1. Login to the Adlibertas dashboard with your username/password

curl'https://publicapi.adlibertas.com/v1/users/login
' -H 'content-type: application/json;charset=UTF-8' --data-binary '{"username":"______@adlibertas.com","password":"_______"}' --compressed

# response will look like this
{"token":"XXXXX","session_id":"XXXXXX"}

2. For a request to be authenticated, set your cookie header to metabase.SESSION_ID=your-session-id-here

Note: the session ID, will be used in the next request. Session IDs are set to expire after 30 days.

Create your Question:

1. Create a new question:

2. Save your question

Example Question: https://metabase.adlibertas.com/question/1646

Note: the 1646 at the end of the request URL, is your report ID <reportID>.

Download the saved question as a CSV:

For CSV: Send an authenticated POST request to https://metabase.adlibertas.com/api/card/<reportID>/query/csv updating the report ID to the desired question.

To download as JSON: Send an authenticated POST request to https://metabase.adlibertas.com/api/card/<reportID>/query/json updating the ID to the desired question.

Last updated