# Get namespace data 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}/{dataview}`

Gets a list of URLs that can be used to download the pull 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>/<DATAVIEW>'
```

## 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}~1{dataview}/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}~1{dataview}/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}~1{dataview}/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}~1{dataview}/get/parameters/3",
  "required": true,
  "schema": {
    "type": "integer"
  }
}
```

### dataview

Location: path. Required: yes.

Type of data to fetch

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

## Request and responses

### Response 200 application/json

Success


Schema:

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




download:
```json
{
  "data": [
    {
      "size": 1024,
      "url": "https://example.invalid/exports/pulls.csv.gz?X-Amz-Expires=21600\u0026X-Amz-Signature=EXAMPLE"
    }
  ]
}
```


## Complete operation contract

```json
{
  "description": "Gets a list of URLs that can be used to download the pull data for the given namespace and timespan.",
  "operationId": "getNamespaceDataByTimespan",
  "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"
      }
    },
    {
      "description": "Type of data to fetch",
      "in": "path",
      "name": "dataview",
      "required": true,
      "schema": {
        "$ref": "#/components/schemas/DataviewType"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "examples": {
            "download": {
              "description": "Use the signed URL returned by the API. The URL and file size in this example are illustrative.",
              "summary": "Illustrative download location",
              "value": {
                "data": [
                  {
                    "size": 1024,
                    "url": "https://example.invalid/exports/pulls.csv.gz?X-Amz-Expires=21600\u0026X-Amz-Signature=EXAMPLE"
                  }
                ]
              }
            }
          },
          "schema": {
            "$ref": "#/components/schemas/ResponseData"
          }
        }
      },
      "description": "Success"
    }
  },
  "summary": "Get namespace data for timespan",
  "tags": [
    "namespaces"
  ]
}
```

## Referenced schemas

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

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

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




