> ## Documentation Index
> Fetch the complete documentation index at: https://docs.enrow.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Risultati telefoni

> Recupera risultati, stato e statistiche di un batch di ricerca di numeri di telefono tramite id

<Badge color="blue">GET</Badge>

```
https://api.enrow.io/phone/bulk?id={batch_id}
```

Recupera i risultati di una ricerca telefonica in blocco inviata in precedenza. Autentica ogni richiesta con la tua [chiave API](/it/authentication) nell'header `x-api-key`.

<Info>
  L'utilizzo di un webhook ti consente di evitare la chiamata a questo endpoint GET. Consulta [Come funzionano i webhook](/it/how-webhooks-work).
</Info>

## Parametri della query

<ParamField query="id" type="string" required>
  L'`id` restituito dalla richiesta POST
</ParamField>

## Risposta

### 200 — Ricerca completata

<ResponseField name="general" type="object">
  Metadati del batch

  <Expandable title="proprietà di general">
    <ResponseField name="id" type="string">
      Identificatore del batch
    </ResponseField>

    <ResponseField name="status" type="string">
      `completed` | `ongoing` | `failed`
    </ResponseField>

    <ResponseField name="custom" type="object">
      Dati personalizzati passati nella richiesta originale
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="stats" type="object">
  Statistiche del batch

  <Expandable title="proprietà di stats">
    <ResponseField name="credits_cost" type="number">
      Totale dei crediti consumati. Consulta [Crediti e fatturazione](/it/credits-billing) per i costi per endpoint.
    </ResponseField>

    <ResponseField name="credits_to_refund" type="number">
      Crediti rimborsati per le ricerche che non hanno restituito alcun risultato. Consulta [Crediti e fatturazione](/it/credits-billing).
    </ResponseField>

    <ResponseField name="requested" type="number">
      Numero totale di ricerche richieste
    </ResponseField>

    <ResponseField name="found" type="number">
      Numero di numeri di telefono trovati
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="results" type="array">
  Array dei risultati della ricerca

  <Expandable title="proprietà dei risultati">
    <ResponseField name="index" type="number">
      Posizione nell'array di ricerca originale
    </ResponseField>

    <ResponseField name="qualification" type="string">
      `found` o `not_found`
    </ResponseField>

    <ResponseField name="number" type="string">
      Il numero di telefono (quando `found`)
    </ResponseField>

    <ResponseField name="country" type="string">
      Codice paese ISO 3166-1 Alpha-2 (es. `"US"`, `"FR"`)
    </ResponseField>

    <ResponseField name="params" type="object">
      I parametri di ricerca originali
    </ResponseField>
  </Expandable>
</ResponseField>

### 200 — Ricerca in corso

<ResponseField name="general" type="object">
  `id` e `status: "ongoing"`
</ResponseField>

<ResponseField name="stats" type="object">
  Conteggi `requested` e `finished`
</ResponseField>

### Risposte di errore

| Codice  | Messaggio                                |
| ------- | ---------------------------------------- |
| **400** | `Missing id in the query params`         |
| **400** | `Could not retrieve bulk search results` |
| **500** | errore del server                        |

Consulta [Gestione degli errori](/it/error-handling) per l'elenco completo dei codici di stato e dei formati di risposta.

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.enrow.io/phone/bulk?id=e3b61122-d6a6-4ea7-b331-9b734682a76a' \
    --header 'x-api-key: YOUR_API_KEY'
  ```

  ```javascript Node.js theme={null}
  const batchId = 'e3b61122-d6a6-4ea7-b331-9b734682a76a';
  const response = await fetch(`https://api.enrow.io/phone/bulk?id=${batchId}`, {
    headers: {
      'x-api-key': process.env.ENROW_API_KEY
    }
  });

  const data = await response.json();
  if (data.general.status === 'completed') {
    console.log(`Found: ${data.stats.found}/${data.stats.requested}`);
    console.log(data.results);
  }
  ```

  ```python Python theme={null}
  import requests
  import os

  batch_id = "e3b61122-d6a6-4ea7-b331-9b734682a76a"
  url = f"https://api.enrow.io/phone/bulk?id={batch_id}"
  headers = {
      "x-api-key": os.getenv("ENROW_API_KEY")
  }

  response = requests.get(url, headers=headers)
  data = response.json()
  if data["general"]["status"] == "completed":
      print(f"Found: {data['stats']['found']}/{data['stats']['requested']}")
  ```
</RequestExample>

<ResponseExample>
  ```json Risposta di successo theme={null}
  {
    "general": {
      "id": "e3b61122-d6a6-4ea7-b331-9b734682a76a",
      "status": "completed"
    },
    "results": [
      {
        "country": "US",
        "index": 0,
        "number": "+15705551234",
        "params": {
          "linkedin_url": "https://www.linkedin.com/in/michael-scott"
        },
        "qualification": "found"
      },
      {
        "country": "US",
        "index": 1,
        "number": "+15705555678",
        "params": {
          "linkedin_url": "https://www.linkedin.com/in/dwight-schrute"
        },
        "qualification": "found"
      }
    ],
    "stats": {
      "credits_cost": 80,
      "credits_to_refund": 0,
      "found": 2,
      "requested": 2
    }
  }
  ```

  ```json Risposta di errore theme={null}
  {
    "message": "..."
  }
  ```
</ResponseExample>

## Passaggi successivi

<CardGroup cols={2}>
  <Card title="Trova telefoni" icon="layer-group" href="/it/api-reference/phone/find-bulk">
    Invia un nuovo batch di ricerche di numeri di telefono.
  </Card>

  <Card title="Ottieni un risultato" icon="inbox" href="/it/api-reference/phone/get-single-result">
    Recupera il risultato di una singola ricerca telefonica tramite id.
  </Card>

  <Card title="Webhook" icon="bell" href="/it/how-webhooks-work">
    Ricevi una notifica automatica al completamento di un batch.
  </Card>

  <Card title="Crediti e fatturazione" icon="coins" href="/it/credits-billing">
    Scopri come vengono consumati e rimborsati i crediti.
  </Card>
</CardGroup>
