> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pingintel.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Usage

> Returns API credit usage over a time range, broken down by data source and time bucket.

Each bucket contains a `counts` map of `source -> locations_reserved + locations_used` — credits tied up (reserved in-flight or consumed) in that interval. The `total` key in `counts` (and in `totals`) carries the cross-source aggregate.

Granularity is chosen automatically based on the requested time range: `5m` for the last day, `1h` for the last 31 days, `1d` for longer ranges.



## OpenAPI

````yaml https://data-api-staging.sovfixer.com/api/schema/?format=json get /api/v1/usage
openapi: 3.0.3
info:
  title: Ping.Data API
  version: v1.0
  description: >
    ### Ping.Data API


    This API provides convenient, efficient access to bulk location data from
    many sources.


    The typical usage flow is:


    * POST to `/api/v1/bulk_enhance`.  The POST body should look like this:

    ``` {
        "locations": [
            {
                "id": "user-id1",
                "address": "1212 Ping Data Lane, Pingville, FL",
                "sources": ["PG", "PH"],
                ...
            },
            ...
        ],
        "timeout": 60.0,
    }

    ```


    * Poll GET `/api/v1/bulk_enhance/{id}`, passing the `id` given by the
    previous response until `response.request.status` is `COMPLETE` or `FAILED`.

    * Download the  data as JSON from `/api/v1/sov/{id}/output/{filename}`. The
    exact url comes from the response to the above query, in
    `response.result.outputs[].url`.


    Output JSON Example:

    ```

    {
      "user-id1": {
        "GG": {
          "is_success": true,
          "error_message": null,
          "confidence": 80,
          "status_code": 200,
          "fetch_time": 4.754,
          "street_number": "1212",
          "route": "Ping Data Ln",
          "location_type": "ROOFTOP",
          "latitude": 28.xxx,
          "longitude": -81.xxx,
          "formatted_address": "1212 Ping Data Lane, Pingville, FL, USA",
          "place_id": "xxx-yyy",
          "address_line_1": "1212 Ping Data Lane",
          "address_line_2": "",
          "city": "Pingville",
          "postal_code": "00010",
          "county": "Pingville",
          "state": "FL",
          "country": "US"
        },
        "HH": {
          "is_success": true,
          "error_message": null,
          "confidence": null,
          "status_code": null,
          "latitude": 28.xxx,
          "longitude": -81.xxx,
          "geocode_type": "ADDRESS",
          "google_maps_link": "https://www.google.com/maps/search/?api=1&query=28.xxx,-81.xxx",
          "fema_flood_zone": "X",
          "elevation": null,
          "bldg_year_built": 2009,
          ... more attributes ...

        }
      },
      ... more buildings ...
    }

    ```
  contact:
    email: support@pingintel.com
    name: Ping Intel
    url: https://www.pingintel.com
servers:
  - url: https://data-api.sovfixer.com
    description: Ping.Data API
  - url: https://data-api-staging.sovfixer.com
    description: Ping.Data API (staging)
security: []
paths:
  /api/v1/usage:
    get:
      tags:
        - Usage
      summary: Get Usage
      description: >-
        Returns API credit usage over a time range, broken down by data source
        and time bucket.


        Each bucket contains a `counts` map of `source -> locations_reserved +
        locations_used` — credits tied up (reserved in-flight or consumed) in
        that interval. The `total` key in `counts` (and in `totals`) carries the
        cross-source aggregate.


        Granularity is chosen automatically based on the requested time range:
        `5m` for the last day, `1h` for the last 31 days, `1d` for longer
        ranges.
      operationId: api_v1_usage
      parameters:
        - in: query
          name: end
          schema:
            type: string
          description: >-
            End of the time range. Accepts a relative offset or ISO 8601 UTC
            timestamp. Defaults to now.
        - in: query
          name: org_short_name
          schema:
            type: string
          description: >-
            Filter by organization short name (e.g. 'AMWNS'). Staff only.
            Mutually exclusive with username.
        - in: query
          name: start
          schema:
            type: string
          description: >-
            Start of the time range. Accepts a relative offset (-5m, -1h, -30d)
            or an ISO 8601 UTC timestamp. Defaults to -30d.
        - in: query
          name: username
          schema:
            type: string
          description: >-
            Filter by this username. Defaults to the requesting user. Staff only
            when querying another user.
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageResponse'
              examples:
                UserUsage—Last7Days:
                  value:
                    granularity: 1h
                    start: '2025-05-08T10:00:00Z'
                    end: '2025-05-15T10:00:00Z'
                    buckets:
                      - bucket: '2025-05-08T10:00:00Z'
                        counts:
                          TD: 12
                          total: 12
                    totals:
                      TD: 100
                      total: 100
                  summary: Hourly buckets for one source over a 7-day window
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageErrorResponse'
          description: ''
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageErrorResponse401'
          description: ''
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageErrorResponse403'
          description: ''
      security:
        - tokenAuth: []
components:
  schemas:
    UsageResponse:
      type: object
      properties:
        buckets:
          type: array
          items:
            $ref: '#/components/schemas/UsageBucket'
          description: Time-series rows ordered by bucket start time.
        end:
          type: string
          format: date-time
          description: Resolved end of the range (UTC).
        granularity:
          enum:
            - 5m
            - 1h
            - 1d
          type: string
          x-spec-enum-id: c44f5ed3abc2f904
          description: Bucket granularity selected based on the time range.
        start:
          type: string
          format: date-time
          description: Resolved start of the range (UTC).
        totals:
          type: object
          additionalProperties:
            type: integer
          description: >-
            Summed count per source key over the entire range. Key 'total' is
            the cross-source aggregate.
      required:
        - buckets
        - end
        - granularity
        - start
        - totals
    UsageErrorResponse:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    UsageErrorResponse401:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    UsageErrorResponse403:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    UsageBucket:
      type: object
      properties:
        bucket:
          type: string
          format: date-time
          description: Bucket start time (UTC).
        counts:
          type: object
          additionalProperties:
            type: integer
          description: >-
            Map of source code -> locations_reserved + locations_used for this
            bucket. Key 'total' is the cross-source aggregate.
      required:
        - bucket
        - counts
  securitySchemes:
    tokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"

````