# Get namespace metadata for timespan


[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/{year}/{timespantype}/{timespan}`

Gets info about data for the given namespace and timespan.

## 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/<YEAR>/<TIMESPANTYPE>/<TIMESPAN>'
```

## 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~1{year}~1{timespantype}~1{timespan}/get/parameters/0",
  "required": true,
  "schema": {
    "type": "string"
  }
}
```

### year

Location: path. Required: yes.

Year to fetch data for

```json
{
  "description": "Year to fetch data for",
  "in": "path",
  "name": "year",
  "pointer": "/paths/~1namespaces~1{namespace}~1pulls~1exports~1years~1{year}~1{timespantype}~1{timespan}/get/parameters/1",
  "required": true,
  "schema": {
    "type": "integer"
  }
}
```

### timespantype

Location: path. Required: yes.

Type of timespan to fetch data for

```json
{
  "description": "Type of timespan to fetch data for",
  "in": "path",
  "name": "timespantype",
  "pointer": "/paths/~1namespaces~1{namespace}~1pulls~1exports~1years~1{year}~1{timespantype}~1{timespan}/get/parameters/2",
  "required": true,
  "schema": {
    "$ref": "#/components/schemas/TimespanType"
  }
}
```

### timespan

Location: path. Required: yes.

Timespan to fetch data for

```json
{
  "description": "Timespan to fetch data for",
  "in": "path",
  "name": "timespan",
  "pointer": "/paths/~1namespaces~1{namespace}~1pulls~1exports~1years~1{year}~1{timespantype}~1{timespan}/get/parameters/3",
  "required": true,
  "schema": {
    "type": "integer"
  }
}
```

## Request and responses

### Response 200 application/json

Success


Schema:

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




Schema example:
```json
{
  "month": 7
}
```

Schema example:
```json
{
  "week": 31
}
```


### Response 404 

Not Found

No response content is declared.






## Complete operation contract

```json
{
  "description": "Gets info about data for the given namespace and timespan.",
  "operationId": "getNamespaceTimespanMetadata",
  "parameters": [
    {
      "description": "Namespace to fetch data for",
      "in": "path",
      "name": "namespace",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "Year to fetch data for",
      "in": "path",
      "name": "year",
      "required": true,
      "schema": {
        "type": "integer"
      }
    },
    {
      "description": "Type of timespan to fetch data for",
      "in": "path",
      "name": "timespantype",
      "required": true,
      "schema": {
        "$ref": "#/components/schemas/TimespanType"
      }
    },
    {
      "description": "Timespan to fetch data for",
      "in": "path",
      "name": "timespan",
      "required": true,
      "schema": {
        "type": "integer"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/TimespanModel"
          }
        }
      },
      "description": "Success"
    },
    "404": {
      "description": "Not Found"
    }
  },
  "summary": "Get namespace metadata for timespan",
  "tags": [
    "namespaces"
  ]
}
```

## Referenced schemas

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

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




