# Get years with data


[API catalog](/reference/api/) · [Publisher analytics overview](/reference/api/dvp/latest/) · [Product manual](https://docs.docker.com/docker-hub/repos/manage/trusted-content/insights-analytics/) · [OpenAPI specification](/reference/api/dvp/latest.yaml)

API version: 1.0.0



`GET /namespaces/{namespace}/pulls/exports/years`

Gets a list of years that have data for the given namespace.

## Connection and access

[API connection and authentication guidance](/reference/api/dvp/latest/#authentication)


Server: `https://hub.docker.com/api/publisher/analytics/v1`

Effective security: alternatives are OR; schemes within an alternative are AND. An empty array declares no HTTP authentication requirement.

```json
[
  {
    "HubAuth": []
  }
]
```
## Example request

Replace placeholders and provide the required credentials or request body.

```console
curl \
  --request GET \
  --header "Authorization: Bearer ${TOKEN}" \
  --header 'Accept: application/json' \
  'https://hub.docker.com/api/publisher/analytics/v1/namespaces/<NAMESPACE>/pulls/exports/years'
```

## Parameters

### namespace

Location: path. Required: yes.

Namespace to fetch data for

```json
{
  "description": "Namespace to fetch data for",
  "in": "path",
  "name": "namespace",
  "pointer": "/paths/~1namespaces~1{namespace}~1pulls~1exports~1years/get/parameters/0",
  "required": true,
  "schema": {
    "type": "string"
  }
}
```

## Request and responses

### Response 200 application/json

Success


Schema:

```json
{
  "$ref": "#/components/schemas/YearData"
}
```




Schema example:
```json
{
  "years": [
    {
      "year": 2025
    }
  ]
}
```


## Complete operation contract

```json
{
  "description": "Gets a list of years that have data for the given namespace.",
  "operationId": "getNamespaceYears",
  "parameters": [
    {
      "description": "Namespace to fetch data for",
      "in": "path",
      "name": "namespace",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/YearData"
          }
        }
      },
      "description": "Success"
    }
  },
  "summary": "Get years with data",
  "tags": [
    "namespaces"
  ]
}
```

## Referenced schemas

- [#/components/schemas/YearData](/reference/api/dvp/latest/schemas/YearData/)




