APIGateway / Paginator / GetUsage


class APIGateway.Paginator.GetUsage#
paginator = client.get_paginator('get_usage')

Creates an iterator that will paginate through responses from APIGateway.Client.get_usage().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
  • usagePlanId (string) –


    The Id of the usage plan associated with the usage data.

  • keyId (string) – The Id of the API key associated with the resultant usage data.

  • startDate (string) –


    The starting date (e.g., 2016-01-01) of the usage data.

  • endDate (string) –


    The ending date (e.g., 2016-12-31) of the usage data.

  • PaginationConfig (dict) –

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) –

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) –

      The size of each page.

    • StartingToken (string) –

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type:



Response Syntax

    'usagePlanId': 'string',
    'startDate': 'string',
    'endDate': 'string',
    'items': {
        'string': [
    'NextToken': 'string'

Response Structure

  • (dict) –

    Represents the usage data of a usage plan.

    • usagePlanId (string) –

      The plan Id associated with this usage data.

    • startDate (string) –

      The starting date of the usage data.

    • endDate (string) –

      The ending date of the usage data.

    • items (dict) –

      The usage data, as daily logs of used and remaining quotas, over the specified time interval indexed over the API keys in a usage plan. For example, {..., "values" : { "{api_key}" : [ [0, 100], [10, 90], [100, 10]]}, where {api_key} stands for an API key value and the daily log entry is of the format [used quota, remaining quota].

      • (string) –

        • (list) –

          • (list) –

            • (integer) –

    • NextToken (string) –

      A token to resume pagination.