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

# Get IP2Company API usage

> Read organization request outcomes and IP2Company credit usage by API key. Reading usage consumes no credits.

See [IP2Company credits and reporting](https://docs.leadpipe.com/ip-to-company/introduction.md#track-your-company-lookup-allowance). Request outcomes and consumed credits are separate; historical charges remain recorded.


## OpenAPI

````yaml /ip-to-company/openapi.json get /v1/usage
openapi: 3.1.0
info:
  title: IP2Company API
  version: 1.0.0
  description: >-
    Look up or enrich an IP-to-company association and track dedicated
    IP2Company credits. Authenticate with your Leadpipe organization API key in
    X-API-Key.
servers:
  - url: https://company.leadpipe.com
    description: Leadpipe production
security:
  - apiKeyAuth: []
tags:
  - name: Visitors
    description: Visitor resources and privacy-bounded activity.
  - name: Usage
    description: Organization usage and billing-period consumption.
paths:
  /v1/usage:
    get:
      tags:
        - Usage
      summary: Get IP2Company API usage
      description: >-
        Returns durable IP2Company request counts,
        company/ISP/unclassified/no-company outcomes,
        pending/missing/invalid/limited/error counts and consumed API credits,
        grouped by organization API key. Every authenticated lookup attempt
        reaching request handling is recorded once; usage reads and invalid
        credentials are excluded. Credit usage is acknowledged with the outcome
        before returning lookup data. Billing counters cover the current
        organization billing period; activity filters do not reset or change
        them. UTC day filters use an inclusive from and exclusive to, default to
        the last 30 UTC days including today, and allow at most 31 days. Keys
        are ordered by API-key ID, without pagination; no activity returns zero
        totals and an empty byKey list. A result exceeding 10,000 key/outcome
        groups fails rather than returning partial totals; filter by apiKeyId.
        Revoked-key history is retained. No IPs, key secrets or raw payloads are
        exposed. Responses are private and must not be cached. Requires an
        active organization API key with IP2Company permission; reports only
        that organization. Reading usage consumes no credits and remains
        available when credits are exhausted. Existing resource validation and
        business-state rules still apply.
      operationId: getIp2companyApiUsage
      parameters:
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
            description: Inclusive UTC day; defaults to 30 days before to.
            example: '2026-11-01'
          required: false
          description: Inclusive UTC day; defaults to 30 days before to.
          name: from
          in: query
          example: '2026-11-01'
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
            description: Exclusive UTC day; defaults to tomorrow. Maximum range 31 days.
            example: '2026-11-13'
          required: false
          description: Exclusive UTC day; defaults to tomorrow. Maximum range 31 days.
          name: to
          in: query
          example: '2026-11-13'
        - schema:
            type: string
            format: uuid
            description: Optional organization API-key ID filter. Never a key secret.
            example: 11111111-1111-4111-8111-111111111111
          required: false
          description: Optional organization API-key ID filter. Never a key secret.
          name: apiKeyId
          in: query
          example: 11111111-1111-4111-8111-111111111111
      responses:
        '200':
          description: Request outcomes and independent IP2Company credit balance.
          content:
            application/json:
              schema:
                type: object
                properties:
                  organizationId:
                    type: string
                    format: uuid
                  from:
                    type: string
                    format: date-time
                  to:
                    type: string
                    format: date-time
                  timezone:
                    type: string
                    enum:
                      - UTC
                  totals:
                    type: object
                    properties:
                      requests:
                        type: integer
                        minimum: 0
                      creditsUsed:
                        type: integer
                        minimum: 0
                      outcomes:
                        type: object
                        properties:
                          company:
                            type: integer
                            minimum: 0
                          isp:
                            type: integer
                            minimum: 0
                          unclassified:
                            type: integer
                            minimum: 0
                          no_company:
                            type: integer
                            minimum: 0
                          pending:
                            type: integer
                            minimum: 0
                          missing:
                            type: integer
                            minimum: 0
                          invalid_request:
                            type: integer
                            minimum: 0
                          credit_limit:
                            type: integer
                            minimum: 0
                          rate_limited:
                            type: integer
                            minimum: 0
                          error:
                            type: integer
                            minimum: 0
                        required:
                          - company
                          - isp
                          - unclassified
                          - no_company
                          - pending
                          - missing
                          - invalid_request
                          - credit_limit
                          - rate_limited
                          - error
                    required:
                      - requests
                      - creditsUsed
                      - outcomes
                  byKey:
                    type: array
                    items:
                      type: object
                      properties:
                        requests:
                          type: integer
                          minimum: 0
                        creditsUsed:
                          type: integer
                          minimum: 0
                        outcomes:
                          type: object
                          properties:
                            company:
                              type: integer
                              minimum: 0
                            isp:
                              type: integer
                              minimum: 0
                            unclassified:
                              type: integer
                              minimum: 0
                            no_company:
                              type: integer
                              minimum: 0
                            pending:
                              type: integer
                              minimum: 0
                            missing:
                              type: integer
                              minimum: 0
                            invalid_request:
                              type: integer
                              minimum: 0
                            credit_limit:
                              type: integer
                              minimum: 0
                            rate_limited:
                              type: integer
                              minimum: 0
                            error:
                              type: integer
                              minimum: 0
                          required:
                            - company
                            - isp
                            - unclassified
                            - no_company
                            - pending
                            - missing
                            - invalid_request
                            - credit_limit
                            - rate_limited
                            - error
                        apiKeyId:
                          type: string
                          format: uuid
                        name:
                          type: string
                      required:
                        - requests
                        - creditsUsed
                        - outcomes
                        - apiKeyId
                        - name
                  credits:
                    type: object
                    properties:
                      enabled:
                        type: boolean
                      limit:
                        type: integer
                        minimum: 0
                      used:
                        type: integer
                        minimum: 0
                      reserved:
                        type: integer
                        minimum: 0
                      remaining:
                        type: integer
                        minimum: 0
                      periodStart:
                        type: string
                        format: date-time
                    required:
                      - enabled
                      - limit
                      - used
                      - reserved
                      - remaining
                      - periodStart
                required:
                  - organizationId
                  - from
                  - to
                  - timezone
                  - totals
                  - byKey
                  - credits
              example:
                organizationId: 11111111-1111-4111-8111-111111111111
                from: '2026-11-12T00:00:00.000Z'
                to: '2026-11-13T00:00:00.000Z'
                timezone: UTC
                totals:
                  requests: 0
                  creditsUsed: 0
                  outcomes:
                    company: 0
                    isp: 0
                    unclassified: 0
                    no_company: 0
                    pending: 0
                    missing: 0
                    invalid_request: 0
                    credit_limit: 0
                    rate_limited: 0
                    error: 0
                byKey: []
                credits:
                  enabled: true
                  limit: 10000
                  used: 0
                  reserved: 0
                  remaining: 10000
                  periodStart: '2026-11-12T00:00:00.000Z'
        '400':
          description: Invalid IP, identifier or usage range.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details: {}
                    required:
                      - code
                      - message
                  meta:
                    type: object
                    properties:
                      timestamp:
                        type: string
                        format: date-time
                      request_id:
                        type: string
                    required:
                      - timestamp
                      - request_id
                required:
                  - error
                  - meta
              example:
                error:
                  code: HTTP_ERROR
                  message: Invalid request
                meta:
                  timestamp: '2026-11-12T00:00:00.000Z'
                  request_id: 11111111-1111-4111-8111-111111111111
        '401':
          description: >-
            A valid Leadpipe API key or the documented dashboard authentication
            is required.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details: {}
                    required:
                      - code
                      - message
                  meta:
                    type: object
                    properties:
                      timestamp:
                        type: string
                        format: date-time
                      request_id:
                        type: string
                    required:
                      - timestamp
                      - request_id
                required:
                  - error
                  - meta
              example:
                error:
                  code: HTTP_ERROR
                  message: Missing X-API-Key header
                meta:
                  timestamp: '2026-11-12T00:00:00.000Z'
                  request_id: 11111111-1111-4111-8111-111111111111
        '403':
          description: The key, organization or feature is not eligible.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details: {}
                    required:
                      - code
                      - message
                  meta:
                    type: object
                    properties:
                      timestamp:
                        type: string
                        format: date-time
                      request_id:
                        type: string
                    required:
                      - timestamp
                      - request_id
                required:
                  - error
                  - meta
              example:
                error:
                  code: HTTP_ERROR
                  message: IP2Company API access is disabled
                meta:
                  timestamp: '2026-11-12T00:00:00.000Z'
                  request_id: 11111111-1111-4111-8111-111111111111
        '429':
          description: >-
            IP2Company credits exhausted or service admission capacity reached.
            Retry-After is emitted only for temporary service limits.
          headers:
            Retry-After:
              description: >-
                Minimum seconds before retrying a temporary capacity limit;
                absent for credit exhaustion.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details: {}
                    required:
                      - code
                      - message
                  meta:
                    type: object
                    properties:
                      timestamp:
                        type: string
                        format: date-time
                      request_id:
                        type: string
                    required:
                      - timestamp
                      - request_id
                required:
                  - error
                  - meta
              example:
                error:
                  code: HTTP_ERROR
                  message: IP2Company credit allowance exhausted
                meta:
                  timestamp: '2026-11-12T00:00:00.000Z'
                  request_id: 11111111-1111-4111-8111-111111111111
        '503':
          description: >-
            Lookup or durable accounting is unavailable. An uncertain accounting
            result must not be retried automatically.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details: {}
                    required:
                      - code
                      - message
                  meta:
                    type: object
                    properties:
                      timestamp:
                        type: string
                        format: date-time
                      request_id:
                        type: string
                    required:
                      - timestamp
                      - request_id
                required:
                  - error
                  - meta
              example:
                error:
                  code: HTTP_ERROR
                  message: IP2Company temporarily unavailable
                meta:
                  timestamp: '2026-11-12T00:00:00.000Z'
                  request_id: 11111111-1111-4111-8111-111111111111
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Organization API key (sk_...). Get yours from Settings > API Keys in the
        dashboard.

````

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