---
title: Get Impressions Usage
slug: web-experimentation/api/get-impressions-usage
docTags: 
createdAt: 2026-10-02T13:15:18.296Z
---

{
  "id": "3TFoVO_nbfg1BzQJmpW6m",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.optimizely.com/v2/billing/usage/{account_id}",
    "servers": [
      {
        "url": "https://api.optimizely.com/v2/billing/usage/{account_id}"
      }
    ],
    "name": "Get Impressions Usage",
    "description": "Get Impressions Usage by account id",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "account_id",
          "type": "integer<int64>",
          "description": "The account ID of the customer",
          "format": "int64"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "per_page",
          "type": "integer",
          "description": "Optional pagination argument that specifies the maximum number of objects to return per request",
          "default": 25,
          "maximum": 100
        },
        {
          "kind": "optional",
          "name": "page",
          "type": "integer",
          "description": "Optional pagination argument that specifies the page to return. If you have 140 objects and you choose to return 100 objects per page you will be able to access the last 40 objects on page 2. The default value is 1.\n",
          "default": 1
        },
        {
          "kind": "required",
          "name": "usage_date_from",
          "type": "string",
          "description": "Start date of date range",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        {
          "kind": "required",
          "name": "usage_date_to",
          "type": "string",
          "description": "End date of date range",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        {
          "kind": "optional",
          "name": "platforms",
          "type": "array",
          "description": "The platform of the Project",
          "default": [
            "edge",
            "fullstack",
            "web"
          ],
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "optional",
          "name": "query",
          "type": "string",
          "description": "<p>Search by experiment_id, project_id.</p>",
          "default": ""
        },
        {
          "kind": "optional",
          "name": "sort",
          "type": "string",
          "description": "The property to sort by.",
          "default": "impression_count"
        },
        {
          "kind": "optional",
          "name": "order",
          "type": "string",
          "description": "The property to sort by.",
          "default": "desc"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKey",
          "name": "apiKey",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        },
        {
          "id": "OAuth2",
          "name": "OAuth2",
          "kind": "optional",
          "type": "oauth2",
          "description": "<p>Write applications that authenticate with the REST API via OAuth 2.0. Or, to authenticate using a personal token, see <a href=\"https://docs.developers.optimizely.com/web/docs/personal-token\" target=\"_blank\">https://docs.developers.optimizely.com/web/docs/personal-token</a></p>",
          "oauth2Flows": {
            "authorizationCode": {
              "authorizationUrl": "https://app.optimizely.com/oauth2/authorize",
              "tokenUrl": "https://app.optimizely.com/oauth2/token",
              "scopes": {
                "all": "Full access to your account"
              }
            }
          },
          "requiredScopes": [
            "read",
            "write"
          ]
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Return Impression Usage info for account",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "ImpressionsUsage[]",
            "schema": [
              {
                "name": "experiment_id",
                "kind": "required",
                "type": "integer<int64>",
                "description": "The ID for the experiment.",
                "example": 3239,
                "format": "int64"
              },
              {
                "name": "experiment_name",
                "kind": "required",
                "type": "string",
                "description": "<p>The Experiment name to display in the Optimizely app. Whitespaces and other non-alphanumeric characters allowed. Defaults to experiment key if left empty.</p>",
                "example": "Renewable energy"
              },
              {
                "name": "experiment_status",
                "kind": "required",
                "type": "string",
                "description": "The status of the Experiment.",
                "example": "Running, Not started"
              },
              {
                "name": "impression_count",
                "kind": "required",
                "type": "integer<int64>",
                "description": "The Impressions count at experiment level.",
                "example": 322010712450,
                "format": "int64"
              },
              {
                "name": "platform",
                "kind": "required",
                "type": "string",
                "description": "The platform of the Project",
                "example": "web, fullstack, edge",
                "default": "web"
              },
              {
                "name": "project_id",
                "kind": "required",
                "type": "integer<int64>",
                "description": "The ID for the project.",
                "example": 3094,
                "format": "int64"
              },
              {
                "name": "project_name",
                "kind": "required",
                "type": "string",
                "description": "The name of the Project.",
                "example": "Landing Page Optimization"
              }
            ],
            "modelRef": "#/components/schemas/ImpressionsUsage",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Invalid ID",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Error",
            "schema": [
              {
                "name": "code",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "messages",
                "kind": "optional",
                "type": "object",
                "description": "",
                "example": "",
                "schema": []
              },
              {
                "name": "uuid",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "",
                "format": "uuid"
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "Invalid credentials",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Error",
            "schema": [
              {
                "name": "code",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "messages",
                "kind": "optional",
                "type": "object",
                "description": "",
                "example": "",
                "schema": []
              },
              {
                "name": "uuid",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "",
                "format": "uuid"
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "403",
        "description": "You do not have permission to account",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Error",
            "schema": [
              {
                "name": "code",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "messages",
                "kind": "optional",
                "type": "object",
                "description": "",
                "example": "",
                "schema": []
              },
              {
                "name": "uuid",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "",
                "format": "uuid"
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Impression Usage not found",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Error",
            "schema": [
              {
                "name": "code",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "messages",
                "kind": "optional",
                "type": "object",
                "description": "",
                "example": "",
                "schema": []
              },
              {
                "name": "uuid",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "",
                "format": "uuid"
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Unexpected error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Error",
            "schema": [
              {
                "name": "code",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "messages",
                "kind": "optional",
                "type": "object",
                "description": "",
                "example": "",
                "schema": []
              },
              {
                "name": "uuid",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "",
                "format": "uuid"
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "hhiWsxmQqPLmTDY_daUWH",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url 'https://api.optimizely.com/v2/billing/usage/{account_id}?per_page=25&page=1&usage_date_from=string&usage_date_to=string&platforms=edge%2Cfullstack%2Cweb&query=string&sort=impression_count&order=desc' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "nR1eNN8oVhRoNob8CWiVA",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.optimizely.com/v2/billing/usage/{account_id}?per_page=25&page=1&usage_date_from=string&usage_date_to=string&platforms=edge,fullstack,web&query=string&sort=impression_count&order=desc\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "UsTlb_rhwO2bDTRecGynC",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.optimizely.com/v2/billing/usage/{account_id}?per_page=25&page=1&usage_date_from=string&usage_date_to=string&platforms=edge,fullstack,web&query=string&sort=impression_count&order=desc\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "QfY_deZGPms4bNCdYKuRe",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.optimizely.com/v2/billing/usage/{account_id}?per_page=25&page=1&usage_date_from=string&usage_date_to=string&platforms=edge,fullstack,web&query=string&sort=impression_count&order=desc\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "hhiWsxmQqPLmTDY_daUWH"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Return Impression Usage info for account\n[\n  {\n    \"experiment_id\": 3239,\n    \"experiment_name\": \"Renewable energy\",\n    \"experiment_status\": \"Running, Not started\",\n    \"impression_count\": 322010712450,\n    \"platform\": \"web, fullstack, edge\",\n    \"project_id\": 3094,\n    \"project_name\": \"Landing Page Optimization\"\n  }\n]"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Invalid ID\n{\n  \"code\": \"\",\n  \"message\": \"\",\n  \"messages\": {},\n  \"uuid\": \"\"\n}"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Invalid credentials\n{\n  \"code\": \"\",\n  \"message\": \"\",\n  \"messages\": {},\n  \"uuid\": \"\"\n}"
        },
        {
          "id": "response-3-403",
          "language": "403",
          "code": "// You do not have permission to account\n{\n  \"code\": \"\",\n  \"message\": \"\",\n  \"messages\": {},\n  \"uuid\": \"\"\n}"
        },
        {
          "id": "response-4-404",
          "language": "404",
          "code": "// Impression Usage not found\n{\n  \"code\": \"\",\n  \"message\": \"\",\n  \"messages\": {},\n  \"uuid\": \"\"\n}"
        },
        {
          "id": "response-5-default",
          "language": "default",
          "code": "// Unexpected error\n{\n  \"code\": \"\",\n  \"message\": \"\",\n  \"messages\": {},\n  \"uuid\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}