For AI agents: the complete documentation index is available at /en/llms.txt, the full documentation bundle is available at /en/llms-full.txt, and this page is available as Markdown at /en/developer/open-api.md.
  • English
  • Data Open API

    Use an API Key to query visits and installs by promotion link or app from your own server, either as a total for a date range or broken down by day. This makes it easy to feed ROIBest data into your own BI, reporting or campaign systems.

    Endpointhttps://openapi.roibest.com/open/v1/stats
    MethodGET
    AuthenticationX-Api-Key request header
    Response formatJSON (UTF-8)
    Time zoneUTC+0
    Queryable rangeLast 90 days, up to 30 days per request

    Quick start

    1. Sign in to the ROIBest dashboard with your main account, click your avatar in the top-right corner → Open API → Generate API Key, and complete email verification.
    2. The full API Key is shown only once, right after it is generated. Copy or download it immediately and store it securely on your server.
    3. Send your first request from your server (replace the ID and Key in the example with your own):
    curl -s 'https://openapi.roibest.com/open/v1/stats?promote_url_id=6347317793&start_date=2026-10-01&end_date=2026-10-07&group_by=day' \
      -H 'X-Api-Key: rbk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

    Authentication

    Include your API Key in the header of every request:

    X-Api-Key: rbk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    • The API Key is accepted only in the request header. A Key placed in URL parameters or the request body is treated as missing.
    • Only the main account can generate and manage API Keys, and each main account has exactly one active Key at a time.
    • After you click Regenerate in the dashboard, the old Key stops working immediately. Get your server configuration ready to switch before you regenerate.
    Security

    Use your API Key on the server side only. Never put it in web pages, mobile apps or public code repositories. If you suspect it has been exposed, regenerate it in the dashboard right away.

    Rate limit

    You can send up to 10 requests per minute. Requests beyond the limit receive HTTP 429; wait a moment before trying again.

    Recommendations
    • For daily data, use group_by=day to fetch the whole range (up to 30 days) in a single request instead of querying day by day.
    • When querying many promotion links or apps, spread the requests out in batches.

    Query statistics

    GET https://openapi.roibest.com/open/v1/stats

    Request parameters

    All parameters are passed as URL query parameters.

    ParameterTypeRequiredExampleDescription
    promote_url_idstringOne of the two6347317793Promotion link ID
    app_idstringOne of the two1024App ID
    start_datestringNo2026-10-01Start date in YYYY-MM-DD format, inclusive
    end_datestringNo2026-10-07End date in YYYY-MM-DD format, inclusive
    group_bystringNodayOmit for the range total; set to day for a daily breakdown

    Query rules:

    • Provide exactly one of promote_url_id and app_id.
    • All dates are in UTC+0. For example, 2026-10-01 covers 2026-10-01 00:00:00 to 23:59:59 UTC.
    • If both dates are omitted, today is queried. If only one is provided, only that day is queried.
    • The end date cannot be later than today (UTC+0).
    • A single request can cover at most 30 days (start and end dates included).
    • Only data from the last 90 days is available: the start date cannot be more than 90 days before today. For example, if today (UTC+0) is November 6, the earliest date you can query is August 8.
    • You can only query promotion links and apps under your own account. Deleted or hidden ones can still be queried and are flagged by the deleted and hidden fields in the response.

    Response fields

    FieldTypeDescription
    codeintBusiness code; 0 means success
    msgstringResult message; success on success
    request_idstringRequest ID; include it when reporting an issue
    data.promote_url_idstring | nullThe promotion link ID when querying by promotion link, otherwise null
    data.app_idstring | nullThe app ID when querying by app, otherwise null
    data.deletedboolWhether it has been deleted
    data.hiddenboolWhether it has been hidden in the dashboard
    data.metricsstring[]Metrics returned, currently ["visit", "install"]
    data.timezonestringTime zone used for the statistics, always UTC
    data.start_datestringStart date of this query
    data.end_datestringEnd date of this query
    data.totalobjectReturned when group_by is omitted: the totals of visit and install over the range
    data.rowsarrayReturned when group_by=day: one row per day in ascending date order; days without data are included with zero counts
    data.rows[].datestringDate in YYYY-MM-DD
    data.rows[].visitintVisits
    data.rows[].installintInstalls

    Example: range total

    GET /open/v1/stats?promote_url_id=6347317793&start_date=2026-10-01&end_date=2026-10-02
    {
      "code": 0,
      "msg": "success",
      "request_id": "9f1c2e7a4b3d4c6e8a0b1c2d3e4f5a6b",
      "data": {
        "app_id": null,
        "promote_url_id": "6347317793",
        "deleted": false,
        "hidden": false,
        "timezone": "UTC",
        "metrics": ["visit", "install"],
        "start_date": "2026-10-01",
        "end_date": "2026-10-02",
        "total": { "visit": 180, "install": 21 }
      }
    }

    Example: daily breakdown

    GET /open/v1/stats?app_id=1024&start_date=2026-10-01&end_date=2026-10-03&group_by=day
    {
      "code": 0,
      "msg": "success",
      "request_id": "0a1b2c3d4e5f60718293a4b5c6d7e8f9",
      "data": {
        "app_id": "1024",
        "promote_url_id": null,
        "deleted": false,
        "hidden": false,
        "timezone": "UTC",
        "metrics": ["visit", "install"],
        "start_date": "2026-10-01",
        "end_date": "2026-10-03",
        "rows": [
          { "date": "2026-10-01", "visit": 100, "install": 12 },
          { "date": "2026-10-02", "visit": 80, "install": 9 },
          { "date": "2026-10-03", "visit": 0, "install": 0 }
        ]
      }
    }

    Metrics

    MetricDescription
    Visits (visit)Sum of Total Visits and Access via Chrome under Promotion Links → Analytics in the dashboard
    Installs (install)Install under Promotion Links → Analytics in the dashboard
    • Both metrics exclude traffic identified as invalid by the system.
    • Days are split by UTC+0. Today's figures are cumulative up to the time of the query.

    Error codes

    On failure, both the HTTP status code and a business code are returned (except for HTTP 429). Example response:

    { "code": 40003, "msg": "date range must not exceed 30 days", "request_id": "9f1c2e7a4b3d4c6e8a0b1c2d3e4f5a6b" }
    HTTP statusBusiness codeDescriptionWhat to do
    40040001promote_url_id / app_id is missing, both are provided, or the format is invalidProvide exactly one of them, as digits only
    40040002Invalid date format, start date after end date, or end date later than todayCheck the date parameters
    40040003Date range exceeds 30 daysSplit it into multiple requests
    40040004Start date is outside the last 90 daysMove the start date into the last 90 days
    40040005Invalid group_by valueOmit it, or set it to day
    40140101API Key is missing, invalid or has been regeneratedCheck the X-Api-Key header and make sure you are using the latest Key
    40140102Account not activated or restrictedActivate your account first if it is not activated; otherwise contact your account manager
    40440401The promotion link or app does not exist or does not belong to your accountCheck that the ID is correct and belongs to your account
    429—Rate limit exceededWait 1 minute before retrying, and reduce your request rate
    50050001Internal server errorRetry later; if it persists, contact your account manager with the request_id
    50350301Service busy, temporarily unable to queryRetry later; avoid sending many retries in a short time
    Retry guidance
    • 429: wait 1 minute before retrying.
    • 500, 503: retry with increasing intervals (e.g. 2s, 4s, 8s), up to 3 times.
    • Other 4xx errors: retrying will not help; fix the request before sending it again.