:doc:`APIGateway <../../apigateway>` / Client / get_usage

*********
get_usage
*********



.. py:method:: APIGateway.Client.get_usage(**kwargs)

  

  Gets the usage data of a usage plan in a specified time interval.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/apigateway-2015-07-09/GetUsage>`_  


  **Request Syntax**
  ::

    response = client.get_usage(
        usagePlanId='string',
        keyId='string',
        startDate='string',
        endDate='string',
        position='string',
        limit=123
    )
    
  :type usagePlanId: string
  :param usagePlanId: **[REQUIRED]** 

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

    

  
  :type keyId: string
  :param keyId: 

    The Id of the API key associated with the resultant usage data.

    

  
  :type startDate: string
  :param startDate: **[REQUIRED]** 

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

    

  
  :type endDate: string
  :param endDate: **[REQUIRED]** 

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

    

  
  :type position: string
  :param position: 

    The current pagination position in the paged result set.

    

  
  :type limit: integer
  :param limit: 

    The maximum number of returned results per page. The default value is 25 and the maximum value is 500.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'usagePlanId': 'string',
          'startDate': 'string',
          'endDate': 'string',
          'position': 'string',
          'items': {
              'string': [
                  [
                      123,
                  ],
              ]
          }
      }
      
    **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.

        
      

      - **position** *(string) --* 
      

      - **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) --* 
          
        
    
  
  
  **Exceptions**
  
  *   :py:class:`APIGateway.Client.exceptions.BadRequestException`

  
  *   :py:class:`APIGateway.Client.exceptions.UnauthorizedException`

  
  *   :py:class:`APIGateway.Client.exceptions.NotFoundException`

  
  *   :py:class:`APIGateway.Client.exceptions.TooManyRequestsException`

  