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

# Dataset Statistics

> Check dataset size, version, and API health (no authentication required)

Returns dataset and API statistics. This endpoint does not require authentication.

## Example Request

```bash theme={null}
curl -X GET "https://htsapi.com/v1/stats"
```

## Example Response

```json theme={null}
{
  "dataset": {
    "total_codes": 34377,
    "chapters": 99,
    "breakdown": {
      "chapters": 99,
      "headings": 1247,
      "subheadings": 5201,
      "statistical_suffixes": 27830
    },
    "version": {
      "name": "HTS 2020 Revision 18",
      "year": 2020,
      "revision": "18"
    },
    "country": "US",
    "last_updated": "2024-01-15"
  },
  "api": {
    "version": "1.0.0",
    "status": "healthy"
  }
}
```

## Response Fields

* `dataset.total_codes`: Total number of HTS codes in the database
* `dataset.chapters`: Number of chapters (2-digit codes)
* `dataset.breakdown`: Breakdown by code level
* `dataset.version`: HTS data version information
* `dataset.country`: Country code (US for HTS)
* `dataset.last_updated`: Date when data was last updated
* `api.version`: API version
* `api.status`: API health status

## Use Cases

* Display dataset information
* Health checks
* Version verification
* Data freshness checks


## OpenAPI

````yaml GET /stats
openapi: 3.0.1
info:
  title: HTS API
  description: >-
    An API for HTS and HS Codes - Enabling supply chain organizations to scale
    with reliable data
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://htsapi.com/v1
security:
  - bearerAuth: []
paths:
  /stats:
    get:
      summary: Dataset Statistics
      description: Returns dataset and API statistics. No authentication required.
      responses:
        '200':
          description: Statistics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatsResponse'
      security: []
components:
  schemas:
    StatsResponse:
      type: object
      properties:
        dataset:
          type: object
          properties:
            total_codes:
              type: integer
            chapters:
              type: integer
            breakdown:
              type: object
            version:
              type: object
              nullable: true
              properties:
                name:
                  type: string
                year:
                  type: integer
                revision:
                  type: string
            country:
              type: string
            last_updated:
              type: string
        api:
          type: object
          properties:
            version:
              type: string
            status:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'API key as Bearer token. Format: Bearer your_hts_api_key'

````