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

# Get usage

> Credits and queries for one calendar month (UTC), with daily and per-source breakdowns. Defaults to the current month. Requires an enterprise API key.



## OpenAPI

````yaml /price-data/openapi.json get /api/v2/account/usage
openapi: 3.1.0
info:
  title: Price Data API
  version: 1.0.0
  description: >-
    The PricePirate Price Data API: asynchronous price and offer lookups across
    idealo, klarna, pricerunner, amazon, google-shopping, bol. Create a job,
    poll it, read the results, and check your credits, usage and billing.
    Authenticated with your enterprise API key via the x-api-key header.


    This document describes API v2, under `/api/v2`. The host name
    `api-v2.pricepirate.com` is not the API version. v2 answers `202 Accepted`
    with a `Location` header while a job is running, so HTTP clients that follow
    that pattern poll on their own. The legacy v1 paths under `/api` keep
    working unchanged and are listed under **Legacy (v1)**; they answer `200`
    instead of `202`.
servers:
  - url: https://api-v2.pricepirate.com
    description: Production
security: []
tags:
  - name: Jobs
    description: Create jobs, poll them and read their results.
  - name: Account
    description: Your balance, limits, usage and billing.
  - name: Meta
    description: This document.
  - name: Observability
    description: Service health.
  - name: Legacy (v1)
    description: >-
      API v1 under `/api`. Kept for existing integrations; use the `/api/v2`
      paths for new ones.
paths:
  /api/v2/account/usage:
    get:
      tags:
        - Account
      summary: Get usage
      description: >-
        Credits and queries for one calendar month (UTC), with daily and
        per-source breakdowns. Defaults to the current month. Requires an
        enterprise API key.
      parameters:
        - name: period
          in: query
          required: false
          description: Month as `YYYY-MM`. Defaults to the current month.
          schema:
            type: string
            examples:
              - 2026-10
      responses:
        '200':
          description: Usage for the month
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Usage'
        '400':
          description: Malformed `period`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '403':
          description: >-
            Account suspended, or the API key does not belong to an enterprise
            account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Usage:
      type: object
      description: >-
        Usage for one calendar month (UTC). Credit figures come from the ledger;
        query figures from your jobs.
      properties:
        period:
          type: object
          properties:
            key:
              type: string
              examples:
                - 2026-10
            start:
              type: string
              format: date-time
            end:
              type: string
              format: date-time
          required:
            - key
            - start
            - end
        credits:
          type: object
          properties:
            granted:
              type: integer
            debited:
              type: integer
            refunded:
              type: integer
            remaining:
              type: integer
              description: >-
                Current month: your spendable balance now. Past month: what that
                month's grants still held when they expired.
            expires_at:
              type:
                - string
                - 'null'
              format: date-time
              description: When the soonest-expiring credits expire (current month only).
          required:
            - granted
            - debited
            - refunded
            - remaining
            - expires_at
        totals:
          type: object
          properties:
            queries:
              type: integer
            found:
              type: integer
            not_found:
              type: integer
            error:
              type: integer
            unsettled:
              type: integer
              description: >-
                Queries in jobs never polled to completion; their outcome is
                unknown.
          required:
            - queries
            - found
            - not_found
            - error
            - unsettled
        by_day:
          type: array
          items:
            type: object
            properties:
              date:
                type: string
                format: date
              queries:
                type: integer
              found:
                type: integer
              not_found:
                type: integer
              error:
                type: integer
            required:
              - date
              - queries
              - found
              - not_found
              - error
        by_endpoint:
          type: array
          items:
            type: object
            properties:
              source:
                type: string
              operation:
                type: string
              country:
                type: string
              queries:
                type: integer
              credits_debited:
                type: integer
              credits_refunded:
                type: integer
              found:
                type: integer
              not_found:
                type: integer
              error:
                type: integer
            required:
              - source
              - operation
              - country
              - queries
              - credits_debited
              - credits_refunded
              - found
              - not_found
              - error
      required:
        - period
        - credits
        - totals
        - by_day
        - by_endpoint
    ErrorBody:
      type: object
      properties:
        error:
          type: boolean
          enum:
            - true
        message:
          type: string
      required:
        - error
        - message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.