# Get pull 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}/repos/{repo}/pulls`

Gets pulls for the given repo.

## 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>/repos/<REPO>/pulls'
```

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

### repo

Location: path. Required: yes.

Repository to fetch data for

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

### timespan

Location: query. Required: no.

Timespan type for fetching data

```json
{
  "description": "Timespan type for fetching data",
  "in": "query",
  "name": "timespan",
  "pointer": "/paths/~1namespaces~1{namespace}~1repos~1{repo}~1pulls/get/parameters/2",
  "required": false,
  "schema": {
    "$ref": "#/components/schemas/TimespanType"
  }
}
```

### period

Location: query. Required: no.

Relative period of the period to fetch data

```json
{
  "description": "Relative period of the period to fetch data",
  "in": "query",
  "name": "period",
  "pointer": "/paths/~1namespaces~1{namespace}~1repos~1{repo}~1pulls/get/parameters/3",
  "required": false,
  "schema": {
    "$ref": "#/components/schemas/PeriodType"
  }
}
```

### group

Location: query. Required: no.

Field to group the data by

```json
{
  "description": "Field to group the data by",
  "in": "query",
  "name": "group",
  "pointer": "/paths/~1namespaces~1{namespace}~1repos~1{repo}~1pulls/get/parameters/4",
  "required": false,
  "schema": {
    "$ref": "#/components/schemas/GroupType"
  }
}
```

## Request and responses

### Response 200 application/json

Success


Schema:

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




Schema example:
```json
{
  "pulls": [
    {
      "end": "2022-08-07T00:00:00Z",
      "ipCount": 10,
      "pullCount": 11,
      "repo": "neo4j-admin",
      "start": "2022-08-01T00:00:00Z"
    },
    {
      "end": "2022-08-14T00:00:00Z",
      "ipCount": 10,
      "pullCount": 11,
      "repo": "neo4j-admin",
      "start": "2022-08-08T00:00:00Z"
    }
  ]
}
```

Schema example:
```json
{
  "pulls": null
}
```


### Response 404 

Not found - repo doesn't exist or user does not have permission to access it

No response content is declared.






## Complete operation contract

```json
{
  "description": "Gets pulls for the given repo.",
  "operationId": "getRepoPulls",
  "parameters": [
    {
      "description": "Namespace to fetch data for",
      "in": "path",
      "name": "namespace",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "Repository to fetch data for",
      "in": "path",
      "name": "repo",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "Timespan type for fetching data",
      "in": "query",
      "name": "timespan",
      "required": false,
      "schema": {
        "$ref": "#/components/schemas/TimespanType"
      }
    },
    {
      "description": "Relative period of the period to fetch data",
      "in": "query",
      "name": "period",
      "required": false,
      "schema": {
        "$ref": "#/components/schemas/PeriodType"
      }
    },
    {
      "description": "Field to group the data by",
      "in": "query",
      "name": "group",
      "required": false,
      "schema": {
        "$ref": "#/components/schemas/GroupType"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/PullData"
          }
        }
      },
      "description": "Success"
    },
    "404": {
      "description": "Not found - repo doesn't exist or user does not have permission to access it"
    }
  },
  "summary": "Get pull data",
  "tags": [
    "namespaces"
  ]
}
```

## Referenced schemas

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

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

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

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




