APIリファレンスのレポート

まずはSingular Reporting API を使って API の背後にある概念に慣れ、ユースケースに適したクエリを見つけるために、 Getting Started with the Singular Reporting API を読むことをお勧め します。

SKAdNetworkAPIリファレンス広告収益化APIリファレンスもご参照ください。

このAPIはSingularのお客様(広告主)にご利用いただけます。Singularのパートナーの方は、代わりに パートナー向けレポートAPIをご覧ください。

 

一般情報

認証

すべてのAPIリクエストにはAPIキーが必要です。キーを取得するには、アカウントにログインし、デベロッパーツール > APIキーに 進みます。リクエストのapi_keyパラメータにキーを挿入するか、Authorization HTTPヘッダの下にトークンを提供することができます。

レート制限

Singular APIのデフォルトの制限は以下の通りです:

  • 非同期レポート: 最大100件の非同期レポートを同時に実行できます。
  • 同期レポート: 最大3つの同期レポートを同時に実行できます。
  • 単一レポート行数制限:クエリごとに最大200K行。
  • 1日のグローバル行数制限: 1日に最大3M行(すべてのクエリで共有)。

Singularは、すべてのお客様に高品質なサービスを継続的に提供するために、所定のエンドポイントのレート制限を調整する権利を留保します。デフォルトの制限を超える特定のニーズがある場合はお問い合わせください。

レポートAPIエンドポイントのリスト

以下のAPIエンドポイントが利用可能です:

Create Async Report POST https://api.singular.net/api/v2.0/create_async_report Returns aggregated statistics.
Data Availability GET https://api.singular.net/api/v2.0/data_availability_status Before querying Create Async Report, use this endpoint to determine whether for a given day, data is available for each of your sources (data connectors).
Get Report Status GET https://api.singular.net/api/v2.0/get_report_status Returns the status of a given report.
Filters GET https://api.singular.net/api/v2.0/reporting/filters Returns all filtering options available for your reports.
Custom Dimensions GET https://api.singular.net/api/custom_dimensions Returns all the custom dimensions available for your reports.
Cohort Metrics GET https://api.singular.net/api/cohort_metrics Returns all the cohort metrics and cohort periods available for your reports.
Conversion Metrics GET https://api.singular.net/api/conversion_metrics Returns all the conversion metrics available for your reports.

非同期レポート作成エンドポイント

POST https://api.singular.net/api/v2.0/create_async_report

使用法

これはSingularからレポートデータを取得するためのメインエンドポイントです。このエンドポイントは、指定したレポート ディメンション、メトリクス、日付、およびその他の詳細に基づいて非同期レポート クエリを生成し、レポート ID を返します。次のステップでは、レポートがいつ終了したかを確認し、ダウンロード URL を取得するために、Get Report Status エンドポイントにクエリを実行します。

Screen_Shot_2020-07-01_at_0.17.35.png

詳細については、『Guide to the Singular Reporting API』の「Querying Process」セクションを参照してください。

制限事項

  • 1日のAPIリクエストでは、返される行数に制限はありません。
  • 1つのリクエストでクエリできるのは最大30日間で、クエリされるレコード数は最大100,000件です。100,000を超えるレコードをクエリするリクエストは成功せず、追加のフィルタリングが必要になります。
  • 日次または週次データを取得するためにAPIと統合する場合は、複数日のクエリを1日に分割し、全期間にわたって反復することをお勧めします。

サンプルクエリー

import requests
  url = "https://api.singular.net/api/v2.0/create_async_report"
  query_params = {"api_key": "<API KEY>"}
  payload = {
    "dimensions":"app,source,os,country_field",
    "metrics": "custom_impressions,custom_clicks,custom_installs",
    "start_date":"2020-01-01",
    "end_date": "2020-01-01",
    "time_breakdown": "all",
    "format": "csv",
    "country_code_format": "iso"
  }
  response = requests.post(url=url, params=query_params, data=payload)
  print(response.text)

クエリーパラメーター

パラメータ フォーマット 説明
Basic Parameters
api_key String API key provided in the Singular console  
start_date Date    
end_date Date    
time_breakdown String Results breakdown by 'day', 'week', 'month' or 'all', which aggregated data over the entire time period  
Field Selection Parameters
dimensions String A comma-separated list of dimensions. See API Report Types for the list of dimensions available based on the type of data you are looking for. See Metrics and Dimensions for more information about each dimension.  
metrics String A comma-separated list of metrics. See API Report Types for the list of metrics available based on the type of data you are looking for. See Metrics and Dimensions for more information about each metric.  
cohort_metrics String A comma-separated list of cohort metrics by name (see What are cohort metrics?). Cohort metrics include any post-conversion events you have defined in the Events page. To retrieve a list of all the available cohort metrics in your account, use the Cohort Metrics endpoint. 'cohort_metrics': '815782610a1ddf,revenue'
cohort_periods String A comma-separated list of cohort periods (see What are cohort metrics?). To retrieve a list of the available cohort periods, use the Cohort Metrics endpoint. 'cohort_periods': '7d,14d,ltv'
Filtering Parameters
app String A comma-separated list of app names to filter the query results by. To retrieve a list of app names, use the Filters endpoint. 'app': 'my_app1,my_app2'
Source String A comma-separated list of ad networks (and other  sources) to filter by. To retrieve a list of ad network names, use the Filters endpoint. 'source': 'facebook,adwords'
filters JSON A JSON list of filter objects where each contains a dimension, operator, and value(s). Use this parameter to apply more advanced filtering. Note that if you specify more than one filter they will be applied with an AND relation. To retrieve a full list of dimensions you can filter by and their potential values, use the Filters endpoint. 'filters': '[{"dimension": "os", "operator": "in","values": [1, 4]}, {"dimension": "source", "operator": "not in", "values": ["adwords"]}]'
Formatting Parameters
format String The format in which the query results will be delivered. Options: "json" (default) or "csv". 'format':'csv'
country_code_format String Either "iso3" (default) or "iso"  
display_alignment Boolean

When set to "true", results will include an alignment row to account for any difference between campaign and creative statistics.

See Why do the creative metrics contain negative values?

 
display_unenriched
Boolean

When set to "true", results will contain the unenriched data.

See Why are there missing (N/A) values in the report?

"display_unenriched":true

出力例

{
      "status": 0,
      "substatus": 0,
      "value": {
          "report_id": "5cfdb747dd464cd09a9c463e5be9691f"
      }
  }

使用可能なディメンションとメトリックス

各フィールドの説明については、『Metrics and Dimensions Glossary』を参照してください。

ネットワーク・データ

ネットワーク・ディメンション
基本的な寸法(すべてのネットワークで使用できるはず):

app
source
adn_campaign_id
adn_campaign_name
adn_campaign_url
data_connector_id
data_connector_source_name
data_connector_username
data_connector_timestamp_utc


オプションの追加寸法(サポートはネットワークによって異なる):

os
platform
country_field
region_field
city_field
dma_id_field
dma_name_field
adn_sub_adnetwork_name
adn_account_id
adn_account_name
adn_sub_campaign_id
adn_sub_campaign_name


キーワードおよび/またはパブリッシャーの内訳(サポートはネットワークによって異なります:)

keyword_id
keyword
publisher_id
publisher_site_id
publisher_site_name


クリエイティブの内訳(サポートはネットワークによって異なり、通常はキーワード/パブリッシャーと同じクエリで引き出すことはできません):

creative_type
adn_creative_id
adn_creative_name
creative_url
creative_image
creative_text
creative_width
creative_height
creative_is_video
asset_id
asset_name


キャンペーンプロパティ(詳細):

bid_type
bid_strategy
bid_amount
campaign_objective
standardized_bid_type
standardized_bid_strategy
original_bid_amount
campaign_status
min_roas
original_metadata_currency


カスタムディメンション:

カスタムディメンション:これらのデフォルトネットワークディメンションに基づいてカスタムディメンションを定義している場合、そのIDを使用してそれらを引き出すことができます。Custom Dimensions Endpointを使用して、アカウントで定義されたすべてのカスタムディメンションとそのIDを取得します。
ネットワーク・メトリック
#
デフォルトのメトリック:

adn_cost
adn_original_cost
adn_original_currency
adn_impressions
adn_clicks
adn_installs


カスタムメトリクス:


お客様の組織で特別なカスタムメトリクス(Singular Supportがお客様のために作成)を使用している場合、APIでのメトリクス名は小文字になり、スペースは下線に置き換えられます。例:ウェブプラットフォームのカスタムメトリック1 = APIではcustom_metric_1

トラッカーデータ

トラッカー寸法
基本寸法(すべてのネットワークで利用可能なはず):

app
source
tracker_campaign_id


オプションの追加寸法(サポートはトラッカーによって異なる):

tracker_campaign_name
os
platform
country_field


カスタム・ディメンション:

これらのデフォルトのトラッカー・ディメンジョンに基づいてカスタム・ディメンジョンを定義している場合、その ID を使用してそれらをプルできます。Custom Dimensions Endpointを使用して、アカウントで定義されたすべてのカスタム・ディメンションとその ID を取得します。
トラッカー・メトリクス
基本的なメトリクス:

tracker_impressions
tracker_clicks
tracker_installs
tracker_conversions
tracker_reengagements
daily_active_users


コホート・メトリクス:

revenue
original_revenue


コホート・メトリクス: 使用できるコホート・メトリクスの完全なリストについては、コホート・メトリクス・エンドポイントを参照してください。 詳細については、コホート・メトリクスとは何かを参照してください。

コーホート・メトリクスには、CPEやCPIなどの比率ベースの計算が含まれることに注意してください。APIレポートでこれらを使用することはお勧めしません(詳細)。


イベント:

定義したイベントの統計情報を取得できます。Singularアプリで定義されたイベント名を使用する代わりに、Cohort Metrics Endpointから取得できるイベントの自動生成IDを使用する必要があります。

カスタムメトリクス:

あなたの組織が(Singularサポートがあなたのために作成した)特別なカスタムメトリクスを使用している場合、API内のメトリクス名は小文字になり、スペースは下線に置き換えられます。例:ウェブプラットフォームのカスタムメトリック1 = API内のcustom_metric_1

結合データ

寸法
基本ディメンション(すべてのネットワークとトラッカーで利用可能であるべき):

app
source
unified_campaign_id
unified_campaign_name


オプションの追加寸法(サポートはネットワーク/トラッカーによって異なる):

os
platform
country_field
adn_sub_adnetwork_ name
adn_account_id
adn_account_name
sub_campaign_id
sub_campaign_name


キーワードおよび/またはパブリッシャー内訳(サポートはネットワーク/トラッカーによって異なります:)

keyword_id
keyword
publisher_id
publisher_site_id
publisher_site_name


クリエイティブの内訳(サポートはネットワークによって異なります:)

creative_type
adn_creative_id
adn_creative_name
creative_url
creative_image
creative_text
creative_width
creative_height
creative_is_video
asset_id
asset_name


カスタムディメンション:

カスタムディメンション:これらのデフォルトディメンションに基づいてカスタムディメンションを定義している場合は、そのIDを使用してプルできます。カスタムディメンション エンドポイントを使用して、アカウントで定義されているすべてのカスタムディメンションとそのIDを取得します。
メトリクス
#
基本的なメトリクス:

adn_cost
adn_original_cost
adn_original_currency
custom_impressions
custom_clicks
custom_installs
tracker_conversions
tracker_reengagements
daily_active_users


動画クリエイティブと動画ベースのキャンペーンの指標:

video_views
video_views_25pct
video_views_50pct
video_views_75pct
completed_video_views
completed_video_view_rate


コホート指標

revenue
original_revenue


コホート・メトリクス: 使用できるコホート・メトリクスの完全なリストについては、コホート・メトリクス・エンドポイントを参照してください。 詳細については、コホート・メトリクスとは何かを参照してください。

コーホート・メトリクスには、CPEやCPIなどの比率ベースの計算が含まれることに注意してください。APIレポートでこれらを使用することはお勧めしません(詳細)。


イベント:

定義したイベントの統計情報を取得できます。Singularアプリで定義されたイベント名を使用する代わりに、Cohort Metrics Endpointから取得できるイベントの自動生成IDを使用する必要があります。

カスタムメトリクス:

あなたの組織が(Singularサポートがあなたのために作成した)特別なカスタムメトリクスを使用している場合、API内のメトリクス名は小文字になり、スペースは下線に置き換えられます。例:ウェブプラットフォームのカスタムメトリック1 = API内のcustom_metric_1

注意事項

  • Singularは利用可能な最高レベルの粒度を提供しようとしていますが、すべてのネットワークやトラッカーがすべての内訳をサポートしているわけではありません。 Singularが各ソースから取得するデータの詳細については、データコネクタの詳細を参照してください。
  • 広告ネットワークから報告されるインプレッション、クリック、インストールなどの統計情報は、トラッカーから報告される統計情報と一致しない場合があります。
  • クリエイティブレベルの結合レポートは、Singularのアトリビューションサービスのユーザーのみが利用できます。
  • カスタムメトリクスはクリエイティブの内訳では利用できない場合があります。カスタムメトリクスの内容によっては(つまり、トラッカーメトリクスを含む計算に基づいている場合)、クリエイティブ別に分類されたレポートに含めると、「壊れた行」が表示される場合があります。

データの可用性エンドポイント

GET https://api.singular.net/api/v2.0/data_availability_status

使用法

このエンドポイントは、指定された日に、ソースまたはデータ コネクターのそれぞれについてデータが利用可能かどうかを返します。

このエンドポイントを使用して、日次レポートを実行する前に、昨日のデータがすでに利用可能かどうかを確認することをお勧めします。

サンプル・クエリ(Python)

import requests
url = "https://api.singular.net/api/v2.0/data_availability_status" queryparams = { "api_key":"<API_KEY>", "expanded":"true", "format": "json", "data_date":"2021-02-01", "display_non_active_sources":"true" } response = requests.get(url=url, params=queryparams)

クエリ・パラメータ

パラメータ 形式 説明
api_key String API key provided in the Singular console.
expanded
Boolean Set to "true" to get the results for each data connector including the data_connector_id field. Then when you run a report in the Create Async Report endpoint, you can filter the results by data_connector_id. Default is "false" for backward compatibility.
format String Output format: "json" or "csv".
data_date Date The day to check data availability for.
display_non_active_sources Boolean [Optional] Set to "true" to include non-active data connectors (data connectors that haven't had data in the last 30 days) in the check.

サンプル出力(expanded=trueの場合)

{
      "status": 0, 
      "substatus": 0, 
      "value": {
          "is_all_data_available": false,
          "data_connectors": [{
              "data_connector_id": "dgd7934875", 
              "data_connector_source_name": "Vungle", 
              "data_connector_username": "ua@mycompany.com", 
              "is_active_last_30_days": true, 
              "is_available": true, 
              "is_empty_data": false, 
              "last_updated_utc": "2021-02-08T10:10:07", 
              "data_connector_timestamp_utc": "2021-02-08T10:10:07", 
              "status": "data populated"
          }, {
              "data_connector_id": "youi293478", 
              "data_connector_source_name": "IronSource", 
              "data_connector_username": "ua@mycompany.com", 
              "is_active_last_30_days": true, 
              "is_available": false, 
              "is_empty_data": "N/A", 
              "last_updated_utc": "N/A", 
              "data_connector_timestamp_utc": "N/A", 
              "status": "data not populated"
          }]
      }
  }

出力パラメータ

パラメータ 書式 説明
is_all_data_available Boolean True if there is data available from all data connectors for the given date. Otherwise false.
data_connectors
  An array containing a JSON object for each of your data connectors.
Parameters per Data Connector
data_connector_id
String A unique identifier for the data connector. You can use this identifier to filter your reports in Create Async Report.
is_available Boolean True if there is data from the specific data connector for the given date.
data_connector_timestamp_utc Timestamp The date and time in which data was last pulled from this data connector for the given date. Use this field if you are auditing historical data and want to see if Singular has fresher data than the one you currently have in your BI platform.
is_empty_data Boolean True if data was pulled successfully from the specific data connector, but the data is empty (all zeros or N/A values). False if data was pulled and contains actual values. Note that if data has not been pulled yet, this field contains "N/A".
status String

Additional information about the status of the data. Possible values:

  • "Data Populated"
  • "Data not Populated": No data yet, but no known issues either.
  • "Login Error": Singular couldn’t pull the data because there is a problem with the credentials.
  • "Setup" or "Not configured": The data connector for this source has not been set up, or there is a problem with the configuration.
  • "Disabled": The data connector has been manually disabled.
is_active_last_30_days Boolean True if this data connector had non-empty data at least once in the last 30 days.
last_updated_utc Timestamp The latest time in which data was saved in the Singular database for this data connector. Note: There may be a gap of up to several hours from the moment in which the data is pulled through the data connector to the time it is saved in the database.

サンプル出力("expanded "パラメーターを含まないかfalseに設定した場合)

#
{'is_all_data available': false,
  'data_sources': [
  {'username': u'facebook@singular.net',
   'status': 'data populated',
   'is_empty_data': false,
   'is_active_last_30_days': true,
   'last_updated_utc': '2018-05-03T10:12:18'
   'source': u'Facebook',
   'is_available': true},
   {'username': u'vungle@singular.net',
   'status': 'data populated',
   'is_empty_data': true,
   'is_active_last_30_days': true,
   'last_updated_utc': '2018-05-03T10:12:18'
   'source': u'Vungle',
   'is_available': true},
   {'username': u'applovin@singular.net',
   'status': 'data not populated',
   'is_empty_data': N/A,
   'is_active_last_30_days': true,
   'last_updated_utc': N/A
   'source': u'Applovin',
   'is_available': false}
  ]}

出力パラメータ

パラメータ 書式 説明
is_all_data_available Boolean True if there is data from all data connectors for the given date. Otherwise false.
is_available Boolean True if there is data from the specific data connector for the given date. Otherwise false.
is_empty_data Boolean True if data was pulled successfully from the specific source, but the data is empty (all zeros or "N/A" values).
status String Additional information about the status of the data. The possible values are:
  • "Data Populated"
  • "Data not Populated": No data yet, but no known issues either.
  • "Login Error": Singular couldn’t pull the data because there is a problem with the credentials.
  • "Setup" or "Not configured": The data connector for this source has not been set up, or there is a problem with the configuration.
  • "Disabled": The data connector has been manually disabled.
See I queried the data availability endpoint and data is missing for one or more networks. What should I do?
is_active_last_30_days Boolean True if data was non-zeroes for at least one day in the last 30 days. Otherwise false.
last_updated_utc Timestamp The latest time in which data was saved in the Singular database for this data connector. Note: There may be a gap of up to several hours from the moment in which the data is pulled through the data connector to the time it is saved in the database.

レポートステータスの取得 エンドポイント

GET https://api.singular.net/api/v2.0/get_report_status

使用法

このエンドポイントは、非同期レポートの作成エンドポイントを使用して生成された所定のレポートのステータスを返します。レポートの実行が終了した場合、エンドポイントはダウンロード URL も返します。

Screen_Shot_2020-07-01_at_0.17.35.png

レポートが失敗した場合、エンドポイントは問題のトラブルシューティングに使用できるエラーメッセージを返します(エラーコードの表、およびAPI FAQ とトラブルシューティングのガイドを参照してください)。

詳しくはSingular Reporting APIガイドの クエリプロセスセクションを参照してください。

重要です

  • レポートが完了するまでに数分かかることがあります。
  • レポートごとに10秒に1回以上レポートステータスのエンドポイントに問い合わせないでください。
  • タイムアウトを設定します。 稀なケースですが、レポートが "Queued "または "Started "ステータスに留まることがあります。30分経ってもステータスが「Done(完了)」または「Failed(失敗)」でない場合は、レポートを再度送信することをお勧めします(これにより、クエリ用の新しいレポートIDが得られます)。

サンプルクエリ

import requests
  url = "https://api.singular.net/api/v2.0/get_report_status"
  querystring = {
    "report_id":"5cfdb747dd45be9691f",
    "api_key": "<API KEY>"
  }
  response = requests.get(url=url, params=querystring)
  print(response.text)

クエリ・パラメータ

パラメータ 形式 説明
api_key String API key provided in the Singular console
report_id String A Report ID returned by the Create Async Report endpoint.

サンプル出力

{
    "status": 0,
    "substatus": 0,
    "value": {
        "status": "DONE",
        "url_expires_in": 3600,
        "generated_url_time_in_utc": "2018-05-13T08:26:18.457690+00:00",
        "url_expired_time_in_utc": "2018-05-13T09:26:18.457690+00:00",
        "download_url": "https://singular-reports-results.s3.amazonaws.com/singular/xxxxxxxxx",
        "report_id": "5cfdb747dd45be9691f"
    }
  }

出力パラメータ

出力パラメータ フォーマット 説明
status String Possible values:
  • "QUEUED": The report is still waiting in the queue.
  • "STARTED": The report is running.
  • "DONE": The report is ready. See the download_URL parameter for the URL from which you can download the report file.
  • "FAILED": The report failed to complete. Read the attached error message and check the Error Codes table and the API FAQ and Troubleshooting page for assistance.
generated_url_time_in_utc Timestamp  
url_expires_in Integer Seconds until the download URL expires.
url_expired_time_in_utc Timestamp  
download_url URL  
report_id String  

フィルター・エンドポイント

GET https://api.singular.net/api/v2.0/reporting/filters

使用法

このヘルパー・エンドポイントを使用して、レポートをフィルタリングできるディメンジョンの最新リストと、各ディメンジョンで可能な値を取得します。

サンプル・クエリ

import requests
  url = "https://api.singular.net/api/v2.0/reporting/filters"
  params = {'api_key': "<API KEY>"}
  result = requests.get(url=url, params=params)
  print result.json()

クエリ・パラメータ

パラメータ 形式 説明
api_key String API key provided in the Singular console

サンプル出力

{
    "status": 0,
    "substatus": 0,
    "value": {
      "dimensions": [
        {
          "name": "os",
          "display_name": "OS",
          "values": [
              {"name": 4, "display_name": "Android"},
              {"name": 1, "display_name": "iOS"}
            ],
        },
        {
          "name": "source",
          "display_name": "Source",
          "values": [{"name": "adwords", "display_name": "AdWords"}]
        }
      ]
    }
  }

カスタム・ディメンション・エンドポイント

GET https://api.singular.net/api/custom_dimensions

使用法

このエンドポイントを使用して、アカウント用に構成されたカスタム・ディメンションの ID を取得します。その後、[非同期レポートの作成] エンドポイントをクエリするときに、カスタム・ディメンジョン ID を使用できます (既定のディメンジョンの代わりに、または既定のディメンジョンに加えて)。

カスタム・ディメンションとその作成方法については、カスタム・ディメンション FAQ を参照してください。

サンプル・クエリ

import requests
  url = "https://api.singular.net/api/custom_dimensions"
  params = {'api_key': "<API KEY>"}
  result = requests.get(url=url, params=params)
  print result.json()

クエリ・パラメータ

パラメータ 形式 説明
api_key String API key provided in the Singular console

サンプル出力

{
    "status": 0,
    "substatus": 0,
    "value": {
      "custom_dimensions": [
        {"display_name": "Channel Type", "id": "e471cb6b83684532e5e83cd"},
        {"display_name": "Region", "id": "1dcfdb1ad861fba4b098e2"}
      ]
    }
  }

コホート指標エンドポイント

GET https://api.singular.net/api/cohort_metrics

使用法

このエンドポイントを使用して、アカウントで利用可能なすべてのコホート・メトリクスとコホート期間を取得します。非同期レポート作成エンドポイントでクエリーを実行する際に、これらのメトリクスと期間を指定できます。

Create Async Reportクエリでは、メトリックの「表示名」ではなく「名前」を使用する必要があることに注意してください。

サンプル クエリ

import requests
  url = "https://api.singular.net/api/cohort_metrics"
  params = {'api_key': "<API KEY>"}
  result = requests.get(url=url, params=params)
  print result.json()

クエリーパラメーター

パラメータ 形式 説明
api_key String API key provided in the Singular console

サンプル出力

{
      "status": 0,
      "substatus": 0,
      "value": {
          "metrics": [
              {"display_name": "ROI","name": "roi"},
              {"display_name": "Revenue","name": "revenue"}
          ],
          "periods": ["1d","3d","5d","7d","14d","30d","actual"]
      }
  }

出力パラメータ

出力パラメータ フォーマット 説明
display_name String The name of the metric as it appears in the Singular platform.
name String The identifier of the metric for use in API queries.
periods Array All the cohort periods supported for your account. For more information, see What are cohort metrics and cohort periods?

変換指標エンドポイント

GET https://api.singular.net/api/conversion_metrics

使用方法

このエンドポイントを使用して、アカウントで利用可能なすべてのコンバージョン イベントを取得します。その後、Create Async Report エンドポイントでクエリーを実行するときに、これらのイベントをメトリックとして指定できます。

Create Async Reportクエリでは、メトリックの「表示名」ではなく「名前」を使用する必要があることに注意してください。

サンプル クエリ

import requests
  url = "https://api.singular.net/api/conversion_metrics"
  params = {'api_key': "<API KEY>"}
  result = requests.get(url=url, params=params)
  print result.json()

クエリーパラメーター

パラメータ 形式 説明
api_key String API key provided in the Singular console

サンプル出力

{
    "status": 0, 
    "substatus": 0, 
    "value": {
      "metrics": [
        {"display_name": "5-second video view", "name": "87dfg34453hsfg6f"}, 
        {"display_name": "5-second video view CPE", "name": "87dfg34453hsfg6fCPE"},   
        {"display_name": "Sign up", "name": "iuq353fidr76w846fha"}, 
        {"display_name": "Sign up CPE", "name": "iuq353fidr76w846fhaCPE"}, 
        {"display_name": "Post engagement", "name": "b59cje9fcgw0th"}, 
        {"display_name": "Post engagement CPE", "name": "b59cje9fcgw0thCPE"},
      ]
    }
  }

出力パラメータ

出力パラメータ フォーマット 説明
display_name String The name of the conversion event as configured in the Events page.
name String The auto-generated identifier of the event - use this identifier in your report query.

エラーコード

Singularは標準的なHTTPレスポンスコードを使用して、APIリクエストの成功または失敗を示します。一般的に、200 のコードは成功に対応し、4xx の範囲のコードは提供された情報が失敗したエラー (必須パラメータが省略されたなど) を示し、5xx のコードはその他の問題を示します。

参照:Reporting API FAQおよびトラブルシューティング

コード エラーテキスト 追加情報
400 An invalid timestamp was given. The timestamp must be of the format: YYYY-MM-DD hh:mm:ss. Specify timestamps as in the following example: 2018-01-01 00:00:01
400 An invalid date was given. The date must be of the format: YYYY-MM-DD. Specify dates as in the following example: 2018-01-20
400 An invalid date range was given. End date must be later than start date.  
400 An invalid time breakdown was given. The time breakdown parameter is either missing in your query or isn't one of the supported options: "day", "week", "month", or "all".
400 An invalid filter was given. Use the Filters endpoint to get the list of filters you can use in your queries.
400 At least one metric must be used. Include at least one metric in your query.
400 The requested data set includes publisher dimensions and extends beyond a single day. Please run single day queries with publisher dimensions. Reports broken down by publisher include large volumes of data. To run these reports, limit them to one day.
400 An invalid result format was given. Please select between JSON and CSV.  
400 An invalid country_code_format was given. Please use "iso3" or "iso".  
400 The request contains invalid dimensions: One or more dimensions you requested in the query are either deprecated or invalid. If you used custom dimensions, double-check that they are available (using the custom dimensions endpoint) and make sure you used the dimension IDs (rather than their display names).
400 The request contains duplicate fields: [list]  
400 The request contains invalid metrics: One or more metrics you requested in the query are either deprecated or invalid. If you used cohort metrics or conversion events, double-check that they are available (using the cohort metrics and conversion events endpoints) and make sure you used the metric names (rather than their display names).
400 The request contains invalid cohort periods: Use the cohort metrics endpoints to check which cohort periods are available for your account.
400 We could not find cohort periods for the following cohort metrics: . Add cohort periods for your cohort metrics.
400 The request contains dimensions from an old API version: . Please use dimensions from the v2 API endpoint only. The request included dimensions from multiple API versions, which is not supported.
400 The request is missing the following parameter: .  
401 An invalid API Key was given. The API key is either missing or invalid. To get your API key, log into your Singular account and go to Developer Tools > API Keys.
401 The provided API key has been previously deactivated. Please contact your administrator. You are using an API key that belonged to a deactivated user. To get your API key, log into your Singular account and go to Developer Tools > API Keys.
403 The provided API key does not have permissions to view the field:
The API key provided does not have permissions to view a dimension or metric you requested. Contact your organization's administrator to make sure you have the permissions you need.
403 The request is denied access. Please contact your administrator. The request is denied. Contact your organization's administrator for further information.
404 Report ID is not found. Please correct it or create a new report. Double-check that you used the Report ID returned from the Create Async Report endpoint. If the error persists, create a new report.
404 Report ID was created with a different key. Please use the same key when requesting status. To query for a report status, you must use the same API key you used to generate the report.
405 METHOD NOT ALLOWED You are probably using GET instead of POST or vice versa in your http request.
429 Query quota is exceeded: only <> reports are currently allowed. The following report IDs are active: . You have exceeded the amount of async reports you are permitted to run at the same time. Wait for your previous requests to complete.
429 Too many requests. Only <> requests per second is currently allowed. You have exceeded the rate limit. Wait for your previous requests to complete.
500 The request has failed due to an internal error. Typically, this just means you should retry your API call. See What should I do if I get a 500 error?