Readers
Readers are reading data from an API source, and transform it into a stream object.
About to develop a new reader? See the How to develop a new reader section.
Just want to use an existing reader? This page provides you with documentation on available commands:
Adobe Analytics Readers
As of May 2020 (last update of this section of the documentation), two versions of Adobe Analytics Reporting API are coexisting: 1.4 and 2.0. As some functionalities of API 1.4 have not been made available in API 2.0 yet (Data Warehouse reports in particular), our Adobe Analytics Readers are also available in these two versions.
How to obtain credentials
Both Adobe Analytics Readers use the JWT authentication framework.
Get developer access to Adobe Analytics (documentation can be found here)
Create a Service Account integration to Adobe Analytics on Adobe Developer Console
Use the generated JWT credentials (Client ID, Client Secret, Technical Account ID, Organization ID and private.key file) to retrieve your Global Company ID (to be requested to Discovery API). All these parameters will be passed to Adobe Analytics Readers.
Adobe Analytics Reader 1.4
Source API
Quickstart
Call example to Adobe Analytics Reader 1.4, getting the number of visits per day and tracking code for a specified Report Suite, between 2020-01-01 and 2020-01-31:
python ack/entrypoints/cli/main.py read_adobe --adobe-client-id <CLIENT_ID> --adobe-client-secret <CLIENT_SECRET> --adobe-tech-account-id <TECH_ACCOUNT_ID> --adobe-org-id <ORG_ID> --adobe-private-key <PRIVATE_KEY> --adobe-global-company-id <GLOBAL_COMPANY_ID> --adobe-report-suite-id <REPORT_SUITE_ID> --adobe-date-granularity day --adobe-report-element-id trackingcode --adobe-report-metric-id visits --adobe-start-date 2020-01-01 --adobe-end-date 2020-01-31 write_console
Didn’t work? See the Troubleshooting section.
Command name
CMD: read_adobe
JSON: adobe_analytics_1_4
Command options
CMD Options |
JSON Options |
Definition |
---|---|---|
|
|
Client ID, that you can find on Adobe Developer Console |
|
|
Client Secret, that you can find on Adobe Developer Console |
|
|
Technical Account ID, that you can find on Adobe Developer Console |
|
|
Organization ID, that you can find on Adobe Developer Console |
|
|
Content of the private.key file, that you had to provide to create the integration. Make sure to enter the parameter in quotes, include headers, and indicate newlines as |
|
|
Global Company ID (to be requested to Discovery API) |
|
|
Should be set to True if you wish to request the list of available Adobe Report Suites (default: False). If set to True, the below parameters should be left empty. |
|
|
ID of the requested Adobe Report Suite |
|
|
ID of the element (i.e. dimension) to include in the report |
|
|
ID of the metric to include in the report |
|
|
Granularity of the report. Possible values: PREVIOUS_DAY, LAST_30_DAYS, LAST_7_DAYS, LAST_90_DAYS |
|
|
Start date of the period to request (format: YYYY-MM-DD) |
|
|
End date of the period to request (format: YYYY-MM-DD) |
Addtional information
The full list of available elements and metrics can be retrieved with the GetElements and GetMetrics methods.
Adobe Analytics Reader 1.4 requests Data Warehouse reports (the “source” parameter is set to “warehouse” in the report description), allowing it to efficiently process multiple-dimension requests.
If you need further information, the documentation of Adobe APIs 1.4 can be found here.
Adobe Analytics Reader 2.0
Source API
Quickstart
Call example to Adobe Analytics Reader 2.0, getting the number of visits per day and tracking code for a specified Report Suite, between 2020-01-01 and 2020-01-31:
python ack/entrypoints/cli/main.py read_adobe_2_0 --adobe-2-0-client-id <CLIENT_ID> --adobe-2-0-client-secret <CLIENT_SECRET> --adobe-2-0-tech-account-id <TECH_ACCOUNT_ID> --adobe-2-0-org-id <ORG_ID> --adobe-2-0-private-key <PRIVATE_KEY> --adobe-2-0-global-company-id <GLOBAL_COMPANY_ID> --adobe-2-0-report-suite-id <REPORT_SUITE_ID> --adobe-2-0-dimension daterangeday --adobe-2-0-dimension campaign --adobe-2-0-start-date 2020-01-01 --adobe-2-0-end-date 2020-01-31 --adobe-2-0-metric visits write_console
Didn’t work? See the Troubleshooting section.
Command name
CMD: read_adobe_2_0
JSON: adobe_analytics_2_0
Command options
CMD Options |
JSON Options |
Definition |
---|---|---|
|
|
Client ID, that you can find on Adobe Developer Console |
|
|
Client Secret, that you can find on Adobe Developer Console |
|
|
Technical Account ID, that you can find on Adobe Developer Console |
|
|
Organization ID, that you can find on Adobe Developer Console |
|
|
Content of the private.key file, that you had to provide to create the integration. Make sure to enter the parameter in quotes, include headers, and indicate newlines as |
|
|
Global Company ID (to be requested to Discovery API) |
|
|
ID of the requested Adobe Report Suite |
|
|
Dimension to include in the report |
|
|
Metric to include in the report |
|
|
Start date of the period to request (format: YYYY-MM-DD) |
|
|
Start date of the period to request (format: YYYY-MM-DD) |
|
|
Date range. By default, not available in Adobe, so choose among ACK default values: YESTERDAY, LAST_7_DAYS, PREVIOUS_WEEK, PREVIOUS_MONTH, LAST_90_DAYS |
Additional information
In API 2.0, dimension and metric names are slightly different from API 1.4. To get new metric and dimension names and reproduce the behavior of Adobe Analytics UI as closely as possible, enable the Debugger feature in Adobe Analytics Workspace: it allow you to visualize the back-end JSON requests made by Adobe Analytics UI to Reporting API 2.0.
In API 2.0, the date granularity parameter was removed, and should now be handled as a dimension: a request featuring
--adobe-dimension daterangeday
will produce a report with a day granularity.API 2.0 does not feature Data Warehouse reports yet (along with other features, that are indicated on the “Current limitations” section of this page). For this reason, if you wish to collect multiple-dimension reports, Adobe Analytics Reader 1.4 might be a more efficient solution in terms of processing time.
If you need any further information, the documentation of Adobe APIs 2.0 can be found here.
Amazon S3 Reader
Source API
Quickstart
Execute the following commands to set your credentials:
export REGION_NAME=<S3 bucket region>
export AWS_ACCESS_KEY_ID=<S3 access key ID>
export AWS_SECRET_ACCESS_KEY=<S3 access key secret>
Once done, launch your S3 reader command. The following command retrieves the blobs located under the Amazon S3 bucket daily_reports
and the blob prefix FR/offline_sales/
.
python ack/entrypoints/cli/main.py read_s3 --s3-bucket daily_reports --s3-prefix FR/offline_sales --s3-format csv write_console
Didn’t work? See the Troubleshooting section.
Command name
CMD: read_s3
JSON: amazon_s3
Command options
CMD Options |
JSON Options |
Definition |
---|---|---|
|
|
S3 bucket name |
|
|
S3 blob prefix. Several prefixes can be provided in a single command. |
|
|
S3 blob format. Possible values: csv, gz. |
|
|
Indicates how to retrieve a blob name from a blob key (a blob key being the combination of a blob prefix and a blob name: <BLOB_PREFIX>/<BLOB_NAME>). The reader splits the blob key on the “/” character: the last element of the output list is considered as the blob name, and is used to name the stream produced by the reader. This option defines how many splits to do. Default: -1 (split on all occurences). |
|
|
Delimiter that should be used to read the .csv file. Default: , |
|
|
List of field names. If set to None (default), the values in the first row of .csv file will be used as field names. |
AWIN Advertiser Reader
Source API
Quickstart
Call example to AWIN Advertiser Reader, getting the advertiser report aggregated by publisher, between 2020-01-01 and 2020-01-31:
python ack/entrypoints/cli/main.py read_awin --awin-auth-token <AUTH TOKEN> --awin-advertiser-id <AWIN ADVERTISER ID> --awin-report-type <REPORT TYPE> --awin-region <REGION> --awin-timezone <TIMEZONE> --awin-start-date 2020-01-01 --awin-end-date 2020-01-31 write_console
Didn’t work? See the Troubleshooting section.
Command name
CMD: read_awin
JSON: awin_advertiser
Command options
CMD Options |
JSON Options |
Definition |
---|---|---|
|
|
Authorisation Token, which can request through the AWIN API documentation website |
|
|
Advertiser ID, which you can find on the AWIN Platform |
|
|
Report Type, which are defined in the Advertiser API documentation |
|
|
Region, which must be as a country code, e.g. ‘FR’ for France |
|
|
AWIN Campaign Name, only required for Campaign reports |
|
|
Timezone, which can be found in the formatting of the aggregated report, in the documentation |
|
|
Interval to collect, only required for Campaign reports |
|
|
Remove the Publisher Tags from the response, if preferred, this defaults to False |
|
|
Start date of the period to request (format: YYYY-MM-DD) |
|
|
Start date of the period to request (format: YYYY-MM-DD) |
Confluence Reader
Source API
Quickstart
The Confluence Reader handles calls to the Get Content endpoint of Confluence Cloud REST API.
The following command retrieves the titles, space names, tiny links and label names of all pages located under the Atlassian domain <ATLASSIAN_DOMAIN>, filtered on the spacekeys <KEY_1> and <KEY_2>.
python ack/entrypoints/cli/main.py read_confluence --confluence-user-login <USER_LOGIN> --confluence-api-token <API_TOKEN> --confluence-atlassian-domain <ATLASSIAN_DOMAIN> --confluence-content-type "page" --confluence-field "title" --confluence-field "space.name" --confluence-field "tiny_link" --confluence-field "label_names" --confluence-spacekey <KEY_1> --confluence-spacekey <KEY_2> write_console
Didn’t work? See the Troubleshooting section.
Command name
CMD: read_confluence
JSON: confluence
Command options
CMD Options |
JSON Options |
Definition |
---|---|---|
|
|
User login associated with your Atlassian account |
|
|
API token associated with your Atlassian account (can be generated on this page) |
|
|
Atlassian domain under which the content to request is located |
|
|
Type of content on which the report should be filtered. Possible values: page (default), blog_post. |
|
|
(Optional) Space keys on which the report should be filtered |
|
|
Fields that should be included in the report (path.to.field.value or custom_field) |
Please visit the following two pages for a better understanding of the Authentification method, and of the parameters used in the Get Content endpoint.
The Confluence Reader supports two types of fields:
Standard fields - You specify the path to the value that you you wish to retrieve in the raw API response (each path item being separated by dots).
Example - The standard field space.name
will retrieve the value "How To Guides"
for the first item, and the value "Clients"
for the second item.
RAW_API_RESPONSE = {"results":
[
{
"title": "Making API requests with ACK",
"space": {"name": "How To Guides"},
"metadata": {"labels": {"results": [{"name": "ack"}, {"name": "api"}]}}
},
{
"title": "Samsung - Precision Marketing",
"space": {"name": "Clients"},
"metadata": {"labels": {"results": [{"name": "pm"}]}}
}
]
}
Custom fields - If the format of the raw API response does not match your needs, you can define a custom field. Available custom fields are described in the CUSTOM_FIELDS variable of the ack.helpers.confluence_helper
module.
Example - The custom field label_names
transforms the value of the source field metadata.labels.results
using the function _get_key_values_from_list_of_dct
. In other words, using the first record of the previous example, it will format [{"name": "ack"}, {"name": "api"}]
into "ack|api"
.
CUSTOM_FIELDS = {
"label_names": {
"source_field": "metadata.labels.results",
"format_function": _get_key_values_from_list_of_dct,
"format_function_kwargs": {"key": "name"},
"formatted_object_type": str
}
}
Facebook Marketing Reader
Source API
Quickstart
The Facebook Marketing Reader handles calls to 2 endpoints of the Facebook Marketing API: Facebook Ad Insights (to retrieve performance data), and Facebook Ad Management (to retrieve configuration data).
Example of Ad Insights Request
python ack/entrypoints/cli/main.py read_facebook --facebook-access-token <ACCESS_TOKEN> --facebook-object-id <OBJECT_ID> --facebook-breakdown age --facebook-breakdown gender --facebook-action-breakdown action_type --facebook-field ad_id --facebook-field ad_name --facebook-field impressions --facebook-field clicks --facebook-field actions[action_type:post_engagement] --facebook-field actions[action_type:video_view] --facebook-field age --facebook-field gender --facebook-time-increment 1 --facebook-start-date 2020-01-01 --facebook-end-date 2020-01-03 write_console
Example of Ad Management Request
python ack/entrypoints/cli/main.py read_facebook --facebook-access-token <ACCESS_TOKEN> --facebook-object-id <OBJECT_ID> --facebook-ad-insights False --facebook-level ad --facebook-field id --facebook-field creative[id] --facebook-add-date-to-report True --facebook-start-date 2020-01-01 --facebook-end-date 2019-01-01 write_console
Didn’t work? See the Troubleshooting section.
Command name
CMD: read_facebook
JSON: facebook
Command options
CMD Options |
JSON Options |
Definition |
---|---|---|
|
|
Facebook App ID. Not mandatory if Facebook Access Token is provided. |
|
|
Facebook App Secret. Not mandatory if Facebook Access Token is provided. |
|
|
Facebook App Access Token. |
|
|
Nature of the root Facebook Object used to make the request. Possible values: pixel (Ad Management requests only), creative (Ad Management requests only), ad, adset, campaign, account (default). |
|
|
ID of the root Facebook Object used to make the request. |
|
|
Granularity of the response. Possible values: pixel (Ad Management requests only), creative (Ad Management requests only), ad (default), adset, campaign, account. |
|
|
True (default) if Ad Insights request, False if Ad Management request. |
|
|
Fields to be retrieved. |
|
|
Start date of the period to request (format: YYYY-MM-DD). This parameter is only relevant for Ad Insights Requests, and Ad Management requests at the Campaign, Adset and Ad levels. |
|
|
End date of the period to request (format: YYYY-MM-DD). This parameter is only relevant for Ad Insights Requests, and Ad Management requests at the Campaign, Adset and Ad levels. |
|
|
Relative time range. Ignored if |
|
|
Cuts the results between smaller time slices within the specified time range. This parameter is only relevant for Ad Insights Requests, and Ad Management requests at the Campaign, Adset and Ad levels. |
|
|
True if you wish to add the date of the request to each response record, False otherwise (default). |
|
|
How to break down the result. This parameter is only relevant for Ad Insights Requests. |
|
|
How to break down action results. This parameter is only relevant for Ad Insights Requests. |
Make sure to select the appropriate
--facebook-level
If Facebook Object Type is… |
Facebook Level can be… |
---|---|
|
account, campaign, adset, ad, creative, pixel |
|
campaign, adset, ad |
|
adset, ad, creative |
|
ad, creative |
|
creative |
|
pixel |
Format Facebook Marketing Reader response using
--facebook-field
2.1. The list of applicable fields can be found on the links below:
Ad Insights Request: all fields
Ad Management Request: Account-level fields, Campaign-level fields, Adset-level fields, Ad-level fields, Creative-level fields, Pixel-level fields
2.2. If you want to select a nested field value, simply indicate the path to this value within the request field.
Facebook Marketing Reader Request
--facebook-field object_story_spec[video_data][call_to_action][value][link]
API Response
"object_story_spec": {
"video_data": {
"call_to_action": {
"type": "LEARN_MORE",
"value": {
"link": "https://www.artefact.com",
"link_format": "VIDEO_LPP"
}
}
}
}
Facebook Marketing Reader Response
{"object_story_spec[video_data][call_to_action][value][link]": "https://www.artefact.com"}
2.3 Action Breakdown filters can be applied to the fields of Ad Insights Requests using the following syntax: <FIELD_NAME>[<ACTION_BREAKDOWN>:<ACTION_BREAKDOWN_VALUE>]. You can combine multiple Action Breakdown filters on the same field by adding them in cascade next to each other.
Facebook Marketing Reader Request
--facebook-action-breakdown action_type
--facebook-field actions[action_type:video_view][action_type:post_engagement]
API Response
"actions": [
{
"action_type": "video_view",
"value": "17"
},
{
"action_type": "link_click",
"value": "8"
},
{
"action_type": "post_engagement",
"value": "25"
},
{
"action_type": "page_engagement",
"value": "12"
}
]
Facebook Marketing Reader Response
{"actions[action_type:video_view]": "17", "actions[action_type:post_engagement]": "25"}
Google Readers
Authentication
You can authenticate to most of the Readers of the Google Suite following the same schema. You’ll need to generate a refresh token to connect via the OAuth flow. A full script to do this can be found in this refresh token generator.
Google Ads Reader
Source API
How to obtain credentials
Using the AdWords API requires four things:
A developer token (Generated at a company level - one per company -, takes around 2 days to be approved by Google) which can be completely independant from the Google Ads Account you will be calling (though you need a Manager Google Ads Account to request a token for your company)
OAuth2 credentials: <CLIENT_ID> and <CLIENT_SECRET>
A refresh token, created with the email address able to access to all the Google Ads Account you will be calling
The ID of the Google Ads Accounts <CLIENT_CUSTOMER_ID> you will be reading from (XXX-XXX-XXXX numbers, written right next to your Account Name)
See the documentation here to apply for access if your Company does not already have a developer token (granting you the right to use the API).
See the documentation here to set-up your OAuth2 credentials and refresh token specifically for your Google Ads Accounts.
Quickstart
The following command retrieves insights about the Ads of my_first_campaign
and my_second_campaign
in the Google Ads Account <CLIENT_CUSTOMER_ID>.
python ack/entrypoints/cli/main.py read_googleads --googleads-developer-token <DEVELOPER_TOKEN> --googleads-client-id <CLIENT_ID> --googleads-client-secret <CLIENT_SECRET> --googleads-refresh-token <REFRESH_TOKEN> --googleads-client-customer-id <XXX-XXX-XXXX CLIENT_CUSTOMER_ID> --googleads-report-type AD_PERFORMANCE_REPORT --googleads-date-range-type LAST_7_DAYS --googleads-field CampaignName --googleads-field AdGroupName --googleads-field Headline --googleads-field Date --googleads-field Impressions --googleads-report-filter "{'field':'CampaignName','operator':'IN','values':['my_first_campaign','my_second_campaign']}"
Didn’t work? See the Troubleshooting section.
Command name
CMD: read_googleads
JSON: google_ads
Command options
CMD Options |
JSON Options |
Definition |
---|---|---|
|
|
Company Developer token for Google Ads API |
|
|
OAuth2 ID |
|
|
OAuth2 secret |
|
|
Refresh token for OAuth2 |
|
|
(Optional) Manager_Account_ID (XXX-XXX-XXXX identifier) |
|
|
GAds_Account_ID (ignored if a manager account ID was given) |
|
|
(Optional) Name of your output stream (“Custom Report” by default) |
|
|
Type of report to be called |
|
|
Type of date range to apply (if “CUSTOM_RANGE”, a min and max date must be specified). Possible values can be found here. |
|
|
(Optional) Start date for “CUSTOM_RANGE” date range (format: YYYY-MM-DD) |
|
|
(Optional) End date for “CUSTOM_RANGE” date range (format: YYYY-MM-DD) |
|
|
Fields to include in the report |
|
|
Filter to apply on a chosen field (Dictionary as String “{‘field’:,’operator’:,’values’:}”) |
|
|
Boolean specifying whether or not rows with zero impressions should be included in the report |
|
|
Boolean used to filter the report on Video Campaigns only (require CampaignId to be listed as a field) |
|
|
Boolean used to add “AccountId” as a field in the output stream. AccountId is not available in the API, but is known since it’s a requirement to call the API (= Client Customer ID) |
See documentation below for a better understanding of the parameters:
Google Analytics Reader
Source API
Quickstart
The following command retrieves sessions, pageviews and bounces volumes by date from 2020-01-01 to 2020-01-03, for the Analytics View <VIEW_ID>.
python ack/entrypoints/cli/main.py read_ga --ga-client-id <CLIENT_ID> --ga-client-secret <CLIENT_SECRET> --ga-view-id <VIEW_ID> --ga-refresh-token <REFRESH_TOKEN> --ga-dimension ga:date --ga-metric sessions --ga-metric ga:pageviews --ga-metric ga:bounces --ga-start-date 2020-01-01 --ga-end-date 2020-01-03 write_console
Didn’t work? See the Troubleshooting section.
Command name
CMD: read_ga
JSON: google_analytics
Command options
CMD Options |
JSON Options |
Definition |
---|---|---|
|
|
OAuth2 ID |
|
|
OAuth2 secret |
|
|
(Optional) Access token for OAuth2 |
|
|
Refresh token for OAuth2 |
|
|
Analytics View ID from which to retrieve data. See documentation here for a better understanding of Google Analytics hierrarchy. |
|
|
Analytics Account ID from which to retrieve data. See documentation here for a better understanding of Google Analytics hierrarchy. |
|
|
Dimensions to include in the report (max 9). Possible values can be found here. |
|
|
Metrics to include in the report (min 1, max 10). Possible values can be found here. |
|
|
Segment ID of a built-in or custom segment (for example gaid::-3) on which report data should be segmented. |
|
|
Start date of the period to request (format: YYYY-MM-DD) |
|
|
End date of the period to request (format: YYYY-MM-DD) |
|
|
<START_DATE> <END_DATE> of the period to request, specified as a unique argument (format: YYYY-MM-DD YYYY-MM-DD) |
|
|
Relative time range. Possible values: PREVIOUS_DAY, LAST_30_DAYS, LAST_7_DAYS, LAST_90_DAYS. |
|
|
Desired sample size. See documentation here for a better understanding of Google Analytics sampling. Possible values: SMALL, DEFAULT, LARGE (default). |
|
|
If set to True (default: False), adds a “ga:viewId” field to the output stream. |
See documentation here for a better understanding of the parameters.
Google Cloud Storage Reader
Source API
Quickstart
Follow these steps to set your credentials:
In your GCP project, create a Service Account with a ‘Storage Object Viewer’ role
Create a .JSON key for this Service Account, and download the key file locally
Execute the following commands:
export project_id=<GCP project ID>
export GCP_KEY_PATH=<Path to the Service Account key file>
Once done, launch your Google Cloud Storage reader command. The following command retrieves the blobs located under the Google Cloud Storage bucket daily_reports
and the blob prefix FR/offline_sales/
:
python ack/entrypoints/cli/main.py read_gcs --gcs-bucket daily_reports --gcs-prefix FR/offline_sales --gcs-format csv write_console
Didn’t work? See the Troubleshooting section.
Command name
CMD: read_gcs
JSON: google_cloud_storage
Command options
CMD Options |
JSON Options |
Definition |
---|---|---|
|
|
Cloud Storage bucket name |
|
|
Cloud Storage blob prefix. Several prefixes can be provided in a single command. |
|
|
Cloud Storage blob format. Possible values: csv, gz |
|
|
Indicates how to retrieve a blob name from a blob key (a blob key being the combination of a blob prefix and a blob name: <BLOB_PREFIX>/<BLOB_NAME>). The reader splits the blob key on the “/” character: the last element of the output list is considered as the blob name, and is used to name the stream produced by the reader. This option defines how many splits to do. Default: -1 (split on all occurences) |
|
|
Delimiter that should be used to read the .csv file. Default: , |
|
|
List of field names. If set to None (default), the values in the first row of .csv file will be used as field names. |
Google Campaign Manager Reader
Source API
Quickstart
The following command retrieves impressions, clicks and cost volumes from 2020-01-01 to 2020-01-03.
python ack/entrypoints/cli/main.py read_dcm --dcm-client-id <CLIENT_ID> --dcm-client-secret <CLIENT_SECRET> --dcm-refresh-token <REFRESH_TOKEN> --dcm-profile-id <PROFILE_ID> --dcm-dimension dfa:date --dcm-metric dfa:impressions --dcm-metric dfa:clicks --dcm-metric dfa:mediaCost --dcm-start-date 2020-01-01 --dcm-end-date 2020-01-03 write_console
Didn’t work? See the Troubleshooting section.
Command name
CMD: read_dcm
JSON: google_dcm
Command options
CMD Options |
JSON Options |
Definition |
---|---|---|
|
|
OAuth2 ID |
|
|
OAuth2 secret |
|
|
(Optional) Access token for OAuth2 |
|
|
Refresh token for OAuth2 |
|
|
ID of the DFA user profile that has been granted permissions to the CM account for which you want to retrieve data. You should have 1 DFA user profile per CM account that you can access. The associated ID can be found directly on your Campaign Manager UI (when accessing your list of CM accounts, on the top right hand corner). |
|
|
Name of the report, that will appear in CM UI. |
|
|
Type of the report. Possible values: CROSS_DIMENSION_REACH, FLOODLIGHT, PATH_TO_CONVERSION, REACH, STANDARD. |
|
|
Dimensions to include in the report. Possible values can be found here. |
|
|
Metrics to include in the report. Possible values can be found here. |
|
|
<FILTER_TYPE> <FILTER_VALUE> association, used to narrow the scope of the report. For instance “dfa:advertiserId XXXXX” will narrow report scope to the performance of Advertiser ID XXXXX. Possible filter types can be found here. |
|
|
Start date of the period to request (format: YYYY-MM-DD) |
|
|
End date of the period to request (format: YYYY-MM-DD) |
|
|
Date range. By default, not available in DCM, so choose among ACK default values: YESTERDAY, LAST_7_DAYS, PREVIOUS_WEEK, PREVIOUS_MONTH, LAST_90_DAYS |
Google DoubleClick Bid Manager Reader (DBM)
Source API
Quickstart
The following command retrieves impressions, clicks and cost volumes filtered on a specific <ADVERTISER_ID> from 2020-01-01 to 2020-01-03.
python ack/entrypoints/cli/main.py read_dbm --dbm-client-id <CLIENT_ID> --dbm-client-secret <CLIENT_SECRET> —dbm-refresh-token <REFRESH_TOKEN> —dbm-filter FILTER_ADVERTISER <ADVERTISER_ID> --dbm-query-dimension FILTER_DATE --dbm-query-metric METRIC_IMPRESSIONS --dbm-query-metric METRIC_CLICKS --dbm-query-metric METRIC_MEDIA_COST_ADVERTISER --dbm-query-param-type TYPE_GENERAL --dbm-request-type custom_query_report --dbm-start-date 2020-01-01 --dbm-end-date 2020-01-03 write_console
Didn’t work? See the Troubleshooting section.
Command name
CMD: read_dbm
JSON: google_dbm
Command options
CMD Options |
JSON Options |
Definition |
---|---|---|
|
|
OAuth2 ID |
|
|
OAuth2 secret |
|
|
(Optional) Access token for OAuth2 |
|
|
Refresh token for OAuth2 |
|
|
Doubleclick Bid Manager API request type. Possible values: existing_query, custom_query, existing_query_report, custom_query_report, lineitems_objects, sdf_objects and list_reports. |
|
|
Query ID. |
|
|
Query title, used to name the reports generated from this query in DV360 UI. |
|
|
How often the query is run. Possible values can be found here. Default: ONE_TIME. |
|
|
<FILTER_TYPE> <FILTER_VALUE> association, used to narrow the scope of the report. For instance “FILTER_ADVERTISER XXXXX” will narrow report scope to the performance of Advertiser ID XXXXX. Possible filter types can be found here. |
|
|
Dimensions to include in the report. Possible values can be found here. |
|
|
Metrics to include in the report. Possible values can be found here. |
|
|
Report type. Possible values can be found here. Default: TYPE_TRUEVIEW. |
|
|
Start date of the period to request (format: YYYY-MM-DD) |
|
|
End date of the period to request (format: YYYY-MM-DD) |
|
|
Sometimes the date range on which metrics are computed is missing from the report. If this option is set to True (default: False), this range will be added. |
|
|
File types |
|
|
Add optional date format for the output stream. Follow the syntax of https://docs.python.org/3.8/library/datetime.html#strftime-strptime-behavior |
|
|
Day range chosen across these values: PREVIOUS_DAY, LAST_30_DAYS, LAST_90_DAYS, LAST_7_DAYS, PREVIOUS_MONTH, PREVIOUS_WEEK |
Google DV360 Reader
Source API
How to obtain credentials
As for DBM, the DV360 API uses OAuth 2.0 for authentication. There is not a single way to generate credentials but one is descrived below:
Enable DV360 API in a GCP project
Generate a client id / client secret pair
Log in with the user that can access DV360
Go to the OAuth 2.0 Playground
Go to the OAuth 2.0 configuration (the wheel in the upper right corner) and put your client id and client secret
Select the DV360 API
Exchange authorization codes for tokens. This is where you may have to log in with the account that can access DV360
You should now have an access token and a refresh token. Save them carefully.
Quickstart
Say you want to get a SDF file for all campaigns of a specific advertiser. You can run:
python ack/entrypoints/cli/main.py read_dv360 --dv360-client-id <CLIENT_ID> --dv360-client-secret <CLIENT_SECRET> --dv360-refresh-token <REFRESH_TOKEN> --dv360-access-token <ACCESS_TOKEN> --dv360-advertiser-id <ADVERTISER_ID> --dv360-filter-type 'FILTER_TYPE_NONE' --dv360-file-type 'FILE_TYPE_CAMPAIGN' write_console
Didn’t work? See the Troubleshooting section.
Command name
CMD: read_dv360
JSON: google_dv360
Command options
CMD Options |
JSON Options |
Definition |
---|---|---|
|
|
Access token you during the process of getting tokens |
|
|
Refresh token you during the process of getting tokens |
|
|
Client ID you generated in the GCP environment |
|
|
Client secret you generated in the GCP environment |
|
|
One of the advertiser IDs you have access to |
|
|
Request type. Choose among ‘sdf_request’ and ‘creative_request’ |
|
|
SDF level |
|
|
SDF filter. Depends on the level. |
Google Search Console Reader
Source API
How to obtain credentials
Using the Google Search Console API requires three main parameters:
OAuth2 credentials: <CLIENT_ID> and <CLIENT_SECRET>
A refresh token, created with the email address able to access to your Google Search Console Account.
The URLs whose performance you want to see
Quickstart
The following command retrieves insights about the URL <SITE_URL> from 2020-01-01 to 2020-01-03.
python ack/entrypoints/cli/main.py read_search_console --search-console-client-id <CLIENT_ID> --search-console-refresh-token <REFRESH_TOKEN> --search-console-site-url <SITE_URL> --search-console-dimensions country --search-console-dimensions device --search-console-start-date 2020-01-01 --search-console-end-date 2020-01-03 write_console
Didn’t work? See the Troubleshooting section.
Command name
CMD: read_search_console
JSON: google_search_console
Command options
CMD Options |
JSON Options |
Definition |
---|---|---|
|
|
OAuth2 ID |
|
|
OAuth2 secret |
|
|
Access token for OAuth2 |
|
|
Refresh token for OAuth2 |
|
|
Dimensions of the report. Possible values can be found here. |
|
|
Site URL whose performance you want to request |
|
|
Start date of the period to request (format: YYYY-MM-DD) |
|
|
End date of the period to request (format: YYYY-MM-DD) |
|
|
Date range. By default, not available in Search Console, so choose among ACK default values: YESTERDAY, LAST_7_DAYS, PREVIOUS_WEEK, PREVIOUS_MONTH, LAST_90_DAYS |
|
|
If set to True, a date column will be included in the report |
|
|
Row number by report page |
See documentation here for a better understanding of the parameters.
Google Search Ads 360 Reader
Source API
How to obtain credentials
Using the Search Ads API requires two things: - OAuth2 credentials: <CLIENT_ID> and <CLIENT_SECRET> - A refresh token, created with the email address able to access to all the Search Ads 360 Account you will be calling
See the documentation here to set-up your OAuth2 credentials and refresh token specifically for Search Ads 360 Reporting.
Quickstart
The following command retrieves insights about the Ads in the Search Ads 360 Account <ADVERTISER_ID> from the agency <AGENCY_ID>.
python ack/entrypoints/cli/main.py read_sa360 --sa360-client-id <CLIENT_ID> --sa360-client-secret <CLIENT_SECRET> --sa360-refresh-token <REFRESH_TOKEN> --sa360-agency-id <AGENCY_ID> --sa360-advertiser-id <ADVERTISER_ID> --sa360-report-type keyword --sa360-column date --sa360-column impr --sa360-column clicks --sa360-start-date 2020-01-01 --sa360-end-date 2020-01-01
Didn’t work? See the Troubleshooting section.
Command name
CMD: read_sa360
JSON: google_sa360
Command options
CMD Options |
JSON Options |
Definition |
---|---|---|
|
|
OAuth2 ID |
|
|
OAuth2 secret |
|
|
(Optional) Access token |
|
|
Refresh token |
|
|
Agency ID to request in SA360 |
|
|
Optional) Advertiser ids to request. If not provided, every advertiser of the agency will be requested |
|
|
(Optional) Name of the output report |
|
|
Type of the report to request. Possible values can be found here. |
|
|
Dimensions and metrics to include in the report |
|
|
(Optional) Saved columns to report. Documentation can be found here. |
|
|
Start date of the period to request (format: YYYY-MM-DD) |
|
|
End date of the period to request (format: YYYY-MM-DD) |
|
|
Date range. By default, not available in SA360, so choose among ACK default values: YESTERDAY, LAST_7_DAYS, PREVIOUS_WEEK, PREVIOUS_MONTH, LAST_90_DAYS |
See documentation here for a better understanding of the parameters.
Google Sheets Reader
Source API
How to obtain credentials
To use the Google Sheets Reader you must first retrieve your credentials. In order to do so, head to console.cloud.google.com. In the header, chose your project or create a new one. Next step is to enable the Google Drive and Google Sheets APIs in the API Library. You’ll find it in the APIs & Services tab. Now that Google Drive API is enabled, click on the Create credentials button on the upper-right corner and enter these informations :
Which API are you using? > Google Drive API
Where will you be calling the API from? > Web server
What data will you be accessing? > Application data
Are you planning to use this API with App Engine or Compute Engine? > No, I’m not using them
Click on What credentials do I need and complete the form. You will find the credentials you need in the .JSON file that will start downloading automatically right after.
Quickstart
This command allows you to retrieve the desired information from a Google Sheet file row-by-row in a dictionary format. For example, given 3 columns a, b, c and 2 rows with respectively the values d, e, f and g, h, i, we would obtain such a dictionary:
{"a": "d", "b": "e", "c": "f"}
{"a": "g", "b": "h", "c": "i"}
Command name
CMD: read_gs
JSON: google_sheets
Command options
CMD Options |
JSON Options |
Definition |
---|---|---|
|
|
Project ID that is given by Google services once you have created your project in the Google Cloud Console. You can retrieve it in the .JSON credential file. |
|
|
Private key ID given by Google services once you have added credentials to the project. You can retrieve it in the .JSON credential file. |
|
|
The path to the private key that is stored in a txt file. You can retrieve it first in the .JSON credential file. |
|
|
Client e-mail given by Google services once you have added credentials to the project. You can retrieve it in the .JSON credential file. |
|
|
Client ID given by Google services once you have added credentials to the project. You can retrieve it in the .JSON credential file. |
|
|
Client certificate given by Google services once you have added credentials to the project. You can retrieve it in the .JSON credential file. |
|
|
The name you have given to your Google Sheet file |
|
|
The page number you want to access. The number pages starts at 0. |
MyTarget Reader
Source API
How to obtain credentials
The mytarget API uses the OAuth2 protocol. There is not a single way to generate credentials, you can find the 3 ways to retrieve your credentials below :
You should now have an access token and a refresh token. Save them carefully.
Quickstart
Say you want to retrieve for all campaigns and its associated banners and stats of a specific advertiser from the 01/01/2020 to the 07/01/2020. You can run:
python ack/entrypoints/cli/main.py read_mytarget --mytarget-client-id <CLIENT_ID> --mytarget-client-secret <CLIENT_SECRET> --mytarget-refresh-token <REFRESH_TOKEN> --mytarget-request-type 'general' --mytarget-start-date <START_DATE> --mytarget-end-date <END_DATE> write_console
If you just want to get the budget instead of the general statistics of each campaign you can try the following:
python ack/entrypoints/cli/main.py read_mytarget --mytarget-client-id <CLIENT_ID> --mytarget-client-secret <CLIENT_SECRET> --mytarget-refresh-token <REFRESH_TOKEN> --mytarget-request-type 'budget' --mytarget-start-date <START_DATE> --mytarget-end-date <END_DATE> write_console
Didn’t work? See the Troubleshooting section.
Command name
CMD: read_mytarget
JSON: mytarget
Command options
CMD Options |
JSON Options |
Definition |
---|---|---|
|
|
Client ID you generated |
|
|
Client secret you generated. |
|
|
Secret token you retrieved during the process of getting tokens |
|
|
Type of report you want to retrieve: performance or budgets. |
|
|
Start date of the period to request (format: YYYY-MM-DD) |
|
|
End date of the period to request (format: YYYY-MM-DD) |
|
|
Date range. By default, not available in MyTarget, so choose among ACK default values: YESTERDAY, LAST_7_DAYS, PREVIOUS_WEEK, PREVIOUS_MONTH, LAST_90_DAYS |
MySQL Reader
Source ORM
SQL Alchemy (using the mysql+pymysql
engine)
Quickstart
The following command retrieves all records from the table <TABLE_NAME> (equivalent to SELECT * FROM <TABLE_NAME>
).
python ack/entrypoints/cli/main.py read_mysql --mysql-user <DATABASE_USER> --mysql-password <DATABASE_PASSWORD> --mysql-host <DATABASE_HOST> --mysql-port <DATABASE_PORT> --mysql-database <DATABASE_NAME> --mysql-table <TABLE_NAME> write_console
Didn’t work? See the Troubleshooting section.
Command name
CMD: read_mysql
JSON: mysql
Command options
CMD Options |
JSON Options |
Definition |
---|---|---|
|
|
Database user |
|
|
Database password |
|
|
Database host |
|
|
Database port |
|
|
Database name |
|
|
SQL query (you must specify either a query or a table) |
|
|
SQL query name (required if you specify a query) |
|
|
Database table on which you want to run a SELECT * query (you must specify either a query or a table) |
|
|
Watermark column (required when using state management) |
|
|
Initial watermark column value (required when using state management) |
|
|
Redis state service hash name |
|
|
Redis state service host |
|
|
Redis state service port |
Radarly Reader
Source API
Quickstart
The following command retrieves data from posts located under the project <PROJECT_ID>
and associated to the focus IDs 00001
and 00002
, from 2020-01-01 to 2020-01-03.
python ack/entrypoints/cli/main.py read_radarly --radarly-client-id <CLIENT_ID> --radarly-client-secret <CLIENT_SECRET> --radarly-pid <PROJECT_ID> --radarly-focus-id 00001 --radarly-focus-id 00002 --radarly-start-date 2020-01-01 --radarly-end-date 2020-01-03
Didn’t work? See the Troubleshooting section.
Command name
CMD: read_radarly
JSON: radarly
Command options
CMD Options |
JSON Options |
Definition |
---|---|---|
|
|
Radarly Client ID |
|
|
Radarly Client Secret |
|
|
Radarly Project ID |
|
|
Focus IDs (several can be provided) |
|
|
Start date of the period to request |
|
|
End date of the period to request |
|
|
Max number of posts to be requested in a single API request |
|
|
Max number of posts to be requested in a single Search query |
|
|
Duration of the rate limit window |
|
|
Max number of posts to be requested over the rate limit window |
|
|
If set to True (default), forces the reader to abide by official API rate limits, using the 2 above parameters. |
|
|
Throttling threshold coefficient |
Salesforce Reader
Source API
Quickstart
The following command retrieves name field values from all Account records.
python ack/entrypoints/cli/main.py read_salesforce --salesforce-consumer-key <CONSUMER_KEY> --salesforce-consumer-secret <CONSUMER_SECRET> --salesforce-user <USERNAME> --salesforce-password <PASSWORD> --salesforce-query 'SELECT name FROM Account' --salesforce-query-name ack-account-name-query write_console
Didn’t work? See the Troubleshooting section.
How to obtain credentials
Create a Connected App by following the instructions detailed on this page: it will generate your authentication credentials.
Command name
CMD: read_salesforce
JSON: salesforce
Command options
CMD Options |
JSON Options |
Definition |
---|---|---|
|
|
Client ID of your Salesforce Connected App |
|
|
Client Secret of your Salesforce Connected App |
|
|
Salesforce username |
|
|
Salesforce password |
|
|
Salesforce object type (you must specify either a Salesforce object type or a SOQL query). With this configuration, the command will retrieve the values of all the fields from the given object records (equivalent to the SOQL query: SELECT <LIST OF ALL OBJECT FIELDS> FROM <OBJECT TYPE>). |
|
|
SOQL query (you must specify either a Salesforce object type or a SOQL query). You can find documentation on Salesforce Object Query Language (SOQL) here. |
|
|
SOQL query name (required if you specify a SOQL query) |
|
|
Salesforce watermark column (required when using state management) |
|
|
Initial Salesforce watermark column value (required when using state management) |
The Trade Desk Reader
Source API
How to obtain credentials
Ask your Account Representative to give you access to The Trade Desk API and UI
He will generally provide you with two distinct accounts: an API account, allowing you to make API calls (Login: ttd_api_{XXXXX}@client.com), and a UI account, allowing you to navigate on The Trade Desk UI to create Report Templates (Login: your professional e-mail address)
Pass the Login and Password of your API account to The Trade Desk connector
Quickstart
To request dimensions and metrics to The Trade Desk API, you should first create a Report Template in The Trade Desk UI, by following the below process:
Connect to The Trade Desk UI using the Login and Password of your UI account
Navigate to Reports > My Reports to land on the Report Templates section
Clone an existing Report Template, edit it to keep only the dimensions and metrics that you want to collect, and save it: it will appear under the Mine section
Provide the exact name of the Report Template you have just created under the CLI option
--ttd-report-template-name
of The Trade Desk connector: the connector will “schedule” a report instance (which may take a few minutes to run), and fetch data to the location of your choice
The following command retrieves the data associated to the Report template named “adgroup_performance_report” between 2020-01-01 and 2020-01-03, filtered on the PartnerId <PARTNER_ID>.
python ack/entrypoints/cli/main.py read_ttd --ttd-login <LOGIN> --ttd-password <PASSWORD> --ttd-partner-id <PARTNER_ID> --ttd-report-template-name adgroup_performance_report --ttd-start-date 2020-01-01 --ttd-end-date 2020-01-03 write_console
Didn’t work? See [troubleshooting](#troubleshooting) section.
Command name
CMD: read_ttd
JSON: the_trade_desk
Command options
CMD Options |
JSON Options |
Definition |
---|---|---|
|
|
Login of your API account |
|
|
Password of your API account |
|
|
Advertiser Ids for which report data should be fetched |
|
|
Exact name of the Report Template to request. Existing Report Templates can be found within the MyReports section of The Trade Desk UI. |
|
|
Name of the Report Schedule to create |
|
|
Start date of the period to request (format: YYYY-MM-DD) |
|
|
End date of the period to request (format: YYYY-MM-DD) |
|
|
Date range. By default, not available in The Trade Desk, so choose among ACK default values: YESTERDAY, LAST_7_DAYS, PREVIOUS_WEEK, PREVIOUS_MONTH, LAST_90_DAYS |
If you need any further information, the documentation of The Trade Desk API can be found here.
Twitter Ads Reader
Source API
How to obtain credentials
Apply for a developer account through this link.
Create a Twitter app on the developer portal: it will generate your authentication credentials.
Apply for Twitter Ads API access by filling out this form. Receiving Twitter approval may take up to 7 business days.
Get access to the Twitter Ads account you wish to retrieve data for, on the @handle that you used to create your Twitter App. Be careful, access levels matter: with an Ad Manager access, you will be able to request all report types; with a Campaign Analyst access, you will be able to request all report types, except ENTITY reports on Card entities.
Quickstart
The Twitter Ads Reader can collect 3 types of reports, making calls to 4 endpoints of the Twitter Ads API:
ANALYTICS reports, making calls to the Asynchronous Analytics endpoint. These reports return performance data for a wide range of metrics, that can be aggregated over time. Output data can be splitted by day when requested over a larger time period.
REACH reports, making calls to the Reach and Average Frequency endpoint. These reports return performance data with a focus on reach and frequency metrics, that cannot be aggregated over time (e.g. the reach of day A and B is not equal to the reach of day A + the reach of day B, as it counts unique individuals). Output data cannot be splitted by day when requested over a larger time period. These reports are available only for the Funding Instrument and Campaign entities.
ENTITY reports, making calls to Campaign Management endpoints if the selected entity is Funding Instrument, Campaign, Line Item, Media Creative or Promoted Tweet, and to the Creative endpoint if the selected entity is Card. These reports return details on entity configuration since the creation of the Twitter Ads account.
Call example for ANALYTICS reports: this call will collect engagement metrics for Line Item entities, splitting the results by day, from 2020-01-01 to 2020-01-03:
python ack/entrypoints/cli/main.py read_twitter --twitter-consumer-key <API_KEY> --twitter-consumer-secret <API_SECRET_KEY> --twitter-access-token <ACCESS_TOKEN> --twitter-access-token-secret <ACCESS_TOKEN_SECRET> --twitter-account-id <ACCOUNT_ID> --twitter-report-type ANALYTICS --twitter-entity LINE_ITEM --twitter-metric-group ENGAGEMENT --twitter-segmentation-type AGE --twitter-granularity DAY --twitter-start-date 2020-01-01 --twitter-end-date 2020-01-03 write_console
Call example for REACH reports: this call will collect reach metrics (total_audience_reach, average_frequency) for Campaign entities, from 2020-01-01 to 2020-01-03:
python ack/entrypoints/cli/main.py read_twitter --twitter-consumer-key <API_KEY> --twitter-consumer-secret <API_SECRET_KEY> --twitter-access-token <ACCESS_TOKEN> --twitter-access-token-secret <ACCESS_TOKEN_SECRET> --twitter-account-id <ACCOUNT_ID> --twitter-report-type REACH --twitter-entity CAMPAIGN --twitter-start-date 2020-01-01 --twitter-end-date 2020-01-03 write_console
Call example for ENTITY reports: this call collects details on the configuration of Campaign entities (id, name, total_budget_amount_local_micro, currency), since the creation of the Twitter Ads account:
python ack/entrypoints/cli/main.py read_twitter --twitter-consumer-key <API_KEY> --twitter-consumer-secret <API_SECRET_KEY> --twitter-access-token <ACCESS_TOKEN> --twitter-access-token-secret <ACCESS_TOKEN_SECRET> --twitter-account-id <ACCOUNT_ID> --twitter-report-type REACH --twitter-entity CAMPAIGN --twitter-entity-attribute id --twitter-entity-attribute name --twitter-entity-attribute total_budget_amount_local_micro --twitter-entity-attribute currency write_console
Didn’t work? See the Troubleshooting section.
Command name
CMD: read_twitter
JSON: twitter
Command options
CMD Options |
JSON Options |
Definition |
---|---|---|
|
|
API key, available in the ‘Keys and tokens’ section of your Twitter Developer App. |
|
|
API secret key, available in the ‘Keys and tokens’ section of your Twitter Developer App. |
|
|
Access token, available in the ‘Keys and tokens’ section of your Twitter Developer App. |
|
|
Access token secret, available in the ‘Keys and tokens’ section of your Twitter Developer App. |
|
|
Specifies the Twitter Account ID for which the data should be returned. |
|
|
Specifies the type of report to collect. Possible values: ANALYTICS, REACH, ENTITY. |
|
|
Specifies the entity type to retrieve data for. Possible values: FUNDING_INSTRUMENT, CAMPAIGN, LINE_ITEM, MEDIA_CREATIVE, PROMOTED_TWEET, CARD. |
|
|
Specific to ENTITY reports. Specifies the entity attribute (configuration detail) that should be returned. To get possible values, print the ENTITY_ATTRIBUTES variable on ack/helpers/twitter_helper.py |
|
|
Specific to ANALYTICS reports. Specifies how granular the retrieved data should be. Possible values: TOTAL (default), DAY. |
|
|
Specific to ANALYTICS reports. Specifies the list of metrics (as a group) that should be returned. Possible values can be found here. |
|
|
Specific to ANALYTICS reports. Scopes the retrieved data to a particular placement. Possible values: ALL_ON_TWITTER (default), PUBLISHER_NETWORK. |
|
|
Specific to ANALYTICS reports. Specifies how the retrieved data should be segmented. Possible values can be found here. |
|
|
Specific to ANALYTICS reports. Required if segmentation_type is set to DEVICES or PLATFORM_VERSION. Possible values can be identified through the targeting_criteria/locations |
|
|
Specific to ANALYTICS reports. Required if segmentation_type is set to CITIES, POSTAL_CODES, or REGION. Possible values can be identified through the GET targeting_criteria/platforms endpoint. |
|
|
Start date of the period to request (format: YYYY-MM-DD). |
|
|
End date of the period to request (format: YYYY-MM-DD). |
|
|
Date range. By default, not available in Twitter, so choose among ACK default values: YESTERDAY, LAST_7_DAYS, PREVIOUS_WEEK, PREVIOUS_MONTH, LAST_90_DAYS |
|
|
If set to True (default: False), the date on which the request is made will appear on each report record. |
If you need any further information, the documentation of Twitter Ads API can be found here. To get a better understanding of Twitter Ads Hierrarchy and Terminology, we advise you to have a look at this page.
Yandex Readers
Source API
How to obtain credentials
In order to access Yandex Direct API, you need two accounts: an advertiser account and a developer account. Here is the process:
Create a developer account if you don’t already have one. Click on the Get started button on this page.
Create and register an app that will access Yandex Direct API via Yandex OAuth.
Keep app client id safe. Log in with your advertiser account and give permission to the app to access your data.
Store your token very carefully.
Log out and log in as a developer and ask permission to access Yandex Direct API (ask for Full access). Fill in the form.
Wait for Yandex support to reply but it should be within a week.
Yandex Campaign Reader
Quickstart
The following command retrieves the daily budget of all your campaigns, since your account creation.
python ack/entrypoints/cli/main.py read_yandex_campaigns --yandex-token <TOKEN> --yandex-field-name Id --yandex-field-name Name --yandex-field-name DailyBudget write_console
Didn’t work? See the Troubleshooting section.
Command name
CMD: read_yandex_campaigns
JSON: yandex_campaign
Command options
Yandex Statistics Reader
Quickstart
The following command retrieves a performance report for all your campaigns, since your account creation.
python ack/entrypoints/cli/main.py read_yandex_statistics --yandex-token <TOKEN> --yandex-report-type AD_PERFORMANCE_REPORT --yandex-field-name AdFormat --yandex-field-name AdId --yandex-field-name Impressions --yandex-include-vat True --yandex-report-language en --yandex-field-name AdGroupName --yandex-field-name AdGroupId --yandex-field-name AdNetworkType --yandex-field-name CampaignId --yandex-field-name CampaignName --yandex-field-name CampaignType --yandex-field-name Date --yandex-field-name Device --yandex-field-name Clicks --yandex-field-name Conversions --yandex-field-name Cost --yandex-date-range ALL_TIME write_console
Didn’t work? See the Troubleshooting section.
Command name
CMD: read_yandex_statistics
JSON: yandex_statistics
Command options
Detailed version here.
CMD Options |
JSON Options |
Definition |
---|---|---|
|
|
Bear token that allows you to authenticate to the API |
|
|
(Optional) Language of the report. Possible values can be found here. |
|
|
(Optional) Filters on a particular field. |
|
|
(Optional) The maximum number of rows in the report. |
|
|
Information you want to collect. Possible values can be found here. |
|
|
Type of report. Linked to the fields you want to select. |
|
|
Possible values can be found here. |
|
|
Adds VAT to your expenses if set to True |
|
|
(Optional) Selects data on a specific period of time. Combined with |
|
|
(Optional) Selects data on a specific period of time. Combined with |
Troubleshooting
You encountered an issue when running a Reader command and you don’t know what’s going on? You may find an answer in the troubleshooting guide below.
Have you installed ACK dependencies? In order to run ACK, you need to install all dependencies. First create a virtual environment and then run
pip install -r requirements.txt
.Have you set
PYTHONPATH
environment variable to the root of ACK folder?Have you checked logs? The code has been implemented so that every error is logged.