# Data Service Request

### 📝 Overview

Once a bulk request is submitted and accepted, each subtask (or query) returns a unique **ID** in the `results` section of the bulk response.\
These IDs represent individual parsing operations that were created based on the payload you submitted (e.g., a product detail fetch, search result parsing, etc.).

You can use these IDs to **retrieve the parsed data** by sending a request to the **Data Service** endpoint.

### 🧩 Endpoint

<pre class="language-bash"><code class="lang-bash"><strong>GET https://data.easyparser.com/v1/queries/{id}
</strong></code></pre>

You may also retrieve only the parsed result directly via:

```bash
GET https://data.easyparser.com/v1/queries/{id}/results?format=json
```

### 👉 Example Request(for JSON Format)

{% tabs fullWidth="false" %}
{% tab title="cURL" %}
{% code overflow="wrap" %}

```bash
curl --location 'https://data.easyparser.com/v1/queries/YOUR_QUERY_ID/results?format=json' \
--header 'api-key: YOUR_API_KEY' \
--data ''
```

{% endcode %}
{% endtab %}

{% tab title="Python" %}
{% code overflow="wrap" %}

```python
import requests

url = "https://data.easyparser.com/v1/queries/YOUR_QUERY_ID/results?format=json"

payload = ""
headers = {
  'api-key': 'YOUR_API_KEY'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

```

{% endcode %}
{% endtab %}

{% tab title="Node.js" %}
{% code overflow="wrap" %}

```javascript
const myHeaders = new Headers();
myHeaders.append("api-key", "YOUR_API_KEY");

const raw = "";

const requestOptions = {
  method: "GET",
  headers: myHeaders,
  body: raw,
  redirect: "follow"
};

fetch("https://data.easyparser.com/v1/queries/YOUR_QUERY_ID/results?format=json", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
```

{% endcode %}
{% endtab %}

{% tab title="HTTP" %}
{% code overflow="wrap" %}

```http
GET /v1/queries/YOUR_QUERY_ID/results?format=json HTTP/1.1
Host: data.easyparser.com
api-key: YOUR_API_KEY
```

{% endcode %}
{% endtab %}

{% tab title="PHP" %}
{% code overflow="wrap" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://data.easyparser.com/v1/queries/YOUR_QUERY_ID/results?format=json',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'api-key: YOUR_API_KEY'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

{% endcode %}
{% endtab %}

{% tab title="GO" %}
{% code overflow="wrap" %}

```go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io"
)

func main() {

  url := "https://data.easyparser.com/v1/queries/YOUR_QUERY_ID/results?format=json"
  method := "GET"

  payload := strings.NewReader(``)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("api-key", "YOUR_API_KEY")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

{% endcode %}
{% endtab %}

{% tab title="C#" %}
{% code overflow="wrap" %}

```csharp
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://data.easyparser.com/v1/queries/YOUR_QUERY_ID/results?format=json");
request.Headers.Add("api-key", "YOUR_API_KEY");
var content = new StringContent("", null, "text/plain");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

```

{% endcode %}
{% endtab %}

{% tab title="Java" %}
{% code overflow="wrap" %}

```java
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
  .url("https://data.easyparser.com/v1/queries/YOUR_QUERY_ID/results?format=json")
  .method("GET", body)
  .addHeader("api-key", "YOUR_API_KEY")
  .build();
Response response = client.newCall(request).execute();
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Request Frequency:** You can send Data Service requests at a frequency up to your plan’s per-minute limit + 20%.
{% endhint %}

### 📩 What Happens After You Send the Request?

Once you send a request to the Data Service using a valid query ID, the system responds with detailed and structured data based on the operation type.

Whether it's a product detail, offer list, search result, or any other supported operation, the response contains all the parsed content ready for use in your application.

👉 To explore the structure of this response and understand the meaning of each field, head over to the [**Data Service Response**](https://easyparser.gitbook.io/easyparser-documentation/~/revisions/gOmy1Mbjp3miuKEmVZe4/bulk-integration/data-service-response) section.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://easyparser.gitbook.io/easyparser-documentation/bulk-integration/data-service-request.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
