# Batch Result Export

GET https://api.apexverify.com/v1/batch/{batch_uuid}/export

Export batch results in XLSX format, consistent with the frontend output, or as a JSON dump including data and result content, with optional additional sections such as statistics and details.

Reference: https://documentation.apexverify.com/api-reference/apex-verify-api/batch/export-v-1-batch-batch-uuid-export-get

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: openapi
  version: 1.0.0
paths:
  /v1/batch/{batch_uuid}/export:
    get:
      operationId: export-v-1-batch-batch-uuid-export-get
      summary: Batch Result Export
      description: >-
        Export batch results in XLSX format, consistent with the frontend
        output, or as a JSON dump including data and result content, with
        optional additional sections such as statistics and details.
      tags:
        - subpackage_batch
      parameters:
        - name: batch_uuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: format
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/BatchExportFormatEnum'
        - name: include_details
          in: query
          required: false
          schema:
            type: boolean
            default: true
        - name: include_statistics
          in: query
          required: false
          schema:
            type: boolean
            default: true
        - name: X-API-Key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Batch export as JSON or XLSX
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchExportModelResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequestsResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
servers:
  - url: https://api.apexverify.com
components:
  schemas:
    BatchExportFormatEnum:
      type: string
      enum:
        - xlsx
        - json
      title: BatchExportFormatEnum
    EmailResultQuality:
      type: string
      enum:
        - good
        - bad
        - risky
        - unknown
      title: EmailResultQuality
    EmailResultResult:
      type: string
      enum:
        - ok
        - invalid
        - error
        - unknown
      title: EmailResultResult
    BatchVerificationResultsEmailSerial:
      type: object
      properties:
        email:
          type: string
        valid:
          type: boolean
        wrong:
          type: boolean
        unknown:
          type: boolean
        quality:
          $ref: '#/components/schemas/EmailResultQuality'
        result:
          $ref: '#/components/schemas/EmailResultResult'
        is_syntax_error:
          type: boolean
        is_free:
          type: boolean
        is_role:
          type: boolean
        is_disposable:
          type: boolean
        is_catch_all:
          type: boolean
      required:
        - email
        - valid
        - wrong
        - unknown
        - quality
        - result
        - is_syntax_error
        - is_free
        - is_role
        - is_disposable
        - is_catch_all
      title: BatchVerificationResultsEmailSerial
    PhoneResultNumberType:
      type: string
      enum:
        - bad_format
        - mobile
        - landline
        - mobile_or_landline
        - toll_free
        - premium
        - shared_cost
        - voip
        - stage_and_screen
        - pager
        - universal_access_number
        - personal_number
        - voicemail_only
        - msrn
        - unknown
      title: PhoneResultNumberType
    PhoneResultLiveStatus:
      type: string
      enum:
        - live
        - dead
        - absent_subscriber
        - no_teleservice_provisioned
        - not_available_network_only
        - no_coverage
        - not_applicable
        - inconclusive
      title: PhoneResultLiveStatus
    BatchVerificationResultsPhoneSerial:
      type: object
      properties:
        phone:
          type: string
        valid:
          type: boolean
        wrong:
          type: boolean
        unknown:
          type: boolean
        type:
          $ref: '#/components/schemas/PhoneResultNumberType'
        status:
          $ref: '#/components/schemas/PhoneResultLiveStatus'
        is_syntax_error:
          type: boolean
        is_ported:
          type: boolean
        current_network_mcc:
          type:
            - string
            - 'null'
        current_network_mnc:
          type:
            - string
            - 'null'
        operator:
          type:
            - string
            - 'null'
      required:
        - phone
        - valid
        - wrong
        - unknown
        - type
        - status
        - is_syntax_error
        - is_ported
      title: BatchVerificationResultsPhoneSerial
    BatchExportModelResponse:
      oneOf:
        - $ref: '#/components/schemas/BatchVerificationResultsEmailSerial'
        - $ref: '#/components/schemas/BatchVerificationResultsPhoneSerial'
      title: BatchExportModelResponse
    BadRequestResponse:
      type: object
      properties:
        message:
          type: string
          default: Bad Request
      title: BadRequestResponse
    UnauthorizedResponse:
      type: object
      properties:
        message:
          type: string
          default: Unauthorized
      title: UnauthorizedResponse
    ForbiddenResponse:
      type: object
      properties:
        message:
          type: string
          default: Forbidden
      title: ForbiddenResponse
    NotFoundResponse:
      type: object
      properties:
        message:
          type: string
          default: Not Found
      title: NotFoundResponse
    ValidationErrorLocItems:
      oneOf:
        - type: string
        - type: integer
      title: ValidationErrorLocItems
    ValidationErrorCtx:
      type: object
      properties: {}
      title: ValidationErrorCtx
    ValidationError:
      type: object
      properties:
        loc:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorLocItems'
        msg:
          type: string
        type:
          type: string
        input:
          description: Any type
        ctx:
          $ref: '#/components/schemas/ValidationErrorCtx'
      required:
        - loc
        - msg
        - type
      title: ValidationError
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
      title: HTTPValidationError
    TooManyRequestsResponse:
      type: object
      properties:
        message:
          type: string
          default: Too Many Requests
      title: TooManyRequestsResponse
    InternalServerErrorResponse:
      type: object
      properties:
        message:
          type: string
          default: >-
            Internal Server Error. Please contact support at
            contact@apexverify.com...
      title: InternalServerErrorResponse
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

```

## SDK Code Examples

```python
import requests

url = "https://api.apexverify.com/v1/batch/batch_uuid/export"

querystring = {"format":"xlsx"}

headers = {"X-API-Key": "<apiKey>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.apexverify.com/v1/batch/batch_uuid/export?format=xlsx';
const options = {method: 'GET', headers: {'X-API-Key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://api.apexverify.com/v1/batch/batch_uuid/export?format=xlsx"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-API-Key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.apexverify.com/v1/batch/batch_uuid/export?format=xlsx")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.apexverify.com/v1/batch/batch_uuid/export?format=xlsx")
  .header("X-API-Key", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.apexverify.com/v1/batch/batch_uuid/export?format=xlsx', [
  'headers' => [
    'X-API-Key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.apexverify.com/v1/batch/batch_uuid/export?format=xlsx");
var request = new RestRequest(Method.GET);
request.AddHeader("X-API-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-API-Key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.apexverify.com/v1/batch/batch_uuid/export?format=xlsx")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```