Short URLs

Short URLs are queries you have saved in the Supermetrics Query Manager . They can be accessed with a unique query ID, allowing you to run the query in real time without using all the normal query parameters.

GET|POST https://api.supermetrics.com/enterprise/v2/query/s/:query_id/json

Please read more about how to make requests.

Use cases

  1. You want to embed the query results in another application and refresh the data daily, but do not want to include or expose your API key.

  2. You want to provide temporary access to the query data. By removing the stored query you
    also disable any related short URLs.

  3. You would like to share a query but do not wish to have the recipients make changes to the query.

Parameters

All query parameters default to the properties created with the original query. Only the following parameters are customizable:

ParameterTypeDescription
sync_timeout int Number of seconds the API should wait for query to finish before returning a response. Defaults to 1800 seconds (30 minutes). Default and maximum values are subject to license restrictions. See async queries for more.
date_range_type Range type Type of date range the query should use. Defaults to value set in original query. You must set to custom if start_date and end_date are used.
start_date Date When date_range_type is custom, the fixed or relative start date for your query. Defaults to value set in original query.
end_date Date When date_range_type is custom, the fixed or relative end date for your query. Defaults to value set in original query.
max_columns integer Maximum number of columns the query results should contain when fields that split by column are used. Defaults to value set in original query.
max_rows integer Maximum number of rows the query results should contain. Defaults to value set in original query.
offset_start integer Starting row index for paginated response. Defaults to 0.
offset_end integer Ending row index for paginated response. Defaults to none.

Example

Request
GET /enterprise/v2/query/9mK6hBesvFskWL...zeEiZDmL4F21Wt0/json?
    &pretty=true
    &json={
        "start_date": "yesterday",
        "end_date": "today",
        "offset_start": 0,
        "offset_end": 99
    }
Response
{
    "meta": {
        "request_id": "tDcBg85cRzVZru7mRVQNkQ35tE4DdsPu"
        "schedule_id": "..."
        "status_code": "SUCCESS",
        "query": {
            "start_date": "2020-01-01",
            "end_date": "2021-05-05",
            "ds_accounts": [
               "567890"
            ],
            "ds_segments": [
               "segment1"
            ],
            "fields": {
                {
                    "id": "date",
                    "field_id": "date",
                    "field_name": "Date",
                    "field_type": "dim",
                    "field_split": "row",
                    "data_type": "string.time.date",
                    "data_column": 0,
                    "visible": true
                },
                {
                    "id": "impressions",
                    "field_id": "impressions",
                    "field_name": "Impressions",
                    "field_type": "met",
                    "field_split": "row",
                    "data_type": "int.number.value",
                    "data_column": 1,
                    "visible": true
                }
            },
            "compare_type": null,
            "compare_show": null,
            "compare_start_date": null,
            "compare_end_date": null,
            "settings": {
                "no_headers": true
            },
            "cache_minutes": null
        },
        "result": {
            "total_columns": 2,
            "total_rows": 25678,
            "run_seconds": 0.391,
            "data_sampled": true,
            "cache_used": true,
            "cache_time": "2020-06-03T10:16:38+00:00"
        },
        "paginate": {
            "prev": null,
            "next": "http://..?json={... "offset_start":100, "offset_end":199}"
        },
    },
    "data": [
        [
            "2020-01-20",
            4384
        ],
        [
            "2020-01-21",
            38518
        ],
        ...
    ]
}
Last updated 2021-11-11 UTC.