# GET Requests

{% columns %}
{% column width="16.666666666666664%" %}
Data type:

URLs:
{% endcolumn %}

{% column %}
Base Company; Clean Employee; Base Employee; Base Jobs

<https://api.coresignal.com/cdapi/v2/data\\_requests/{data\\_request\\_id}/files\\>
<https://api.coresignal.com/cdapi/v2/data\\_requests/{data\\_request\\_id}/files/{file\\_name}>
{% endcolumn %}
{% endcolumns %}

***

## Overview

Send a GET request to each of the specified GET endpoints to retrieve data in bulk:

1. Make a query in the `/v2/data_requests/{data_request_id}/files` endpoint to see the status of your data request. Collect the file name to use further.
2. Collect the data request ID and the file name. Make a query in the `/v2/data_requests/{data_request_id}/files/{file_name}` endpoint and download the data in a JSON.gz file.

{% hint style="info" %}
You can download the prepared dataset as many times as you like within 30 days of the query submission.
{% endhint %}

***

## Instructions

### GET the file name

Send a GET request to the endpoint `/v2/data_requests/{data_request_id}/files` to see the status of your data request.&#x20;

#### Endpoint usage

1. Take the data `request ID` (obtained from any of the POST endpoints). Paste it in the following cURL request instead of `{request_id}` and your API Key instead of `{API Key}`:

{% code title="Request body template" %}

```json
curl -X 'GET' \
'https://api.coresignal.com/cdapi/v2/data_requests/{data_request_id}/files' \
-H 'accept: application/json' \
-H 'apikey: {API Key}'
```

{% endcode %}

2. Import the cURL request to any API-compatible application.
3. Send the request.

* If you do not see a file name, the data request is not ready. Send the request again until you can see the file name.

4. Retrieve the file name.

{% code title="File name example" %}

```json
{
  "data_request_files": [
    "json/part-00000-2c3d41c2-99c2-43ff-a39c-7ad7h63h7cd9-h000.json.gz"
  ]
}
```

{% endcode %}

* Each JSON.gz file contains a maximum of 10,000 JSON records. Requests that exceed the limit will be rejected.

#### Insufficient credits

The following message indicates that your query is too expensive.

{% hint style="info" %}
Try adding `"limit": {integer}` parameter to your query.
{% endhint %}

{% code title="Insufficient credits" %}

```json
{
    "detail": "Insufficient credits"
}
```

{% endcode %}

***

### GET the file

Request downloadable files by making a GET request to the `/v2/data_requests/{data_request_id}/files/{file_name}` endpoint.

#### Endpoint usage

1. Paste the data `request ID` and `file name` in the following template. Use your API Key instead of `{API Key}`:

{% code title="Request body template" %}

```json
curl -X 'GET' \
'https://api.coresignal.com/cdapi/v2/data_requests/{data_request_id}/files/{file_name}' \
  -H 'accept: application/json' \
  -H 'apikey: {API Key}'
```

{% endcode %}

{% hint style="info" %}
The data request ID is obtained via the POST requests.\
The file name is obtained using the data request ID in the */v2/data\_requests/{data\_request\_id}/files* endpoin&#x74;*.*
{% endhint %}

2. Import the cURL to any API-compatible application.
3. Send the request
4. Download the data

Check for similar methods to retrieve the file using other API-compatible applications.
