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

# Poll a job as CSV

> The same job view as `GET /api/jobs/{jobId}`, flattened to CSV with **one row per offer**. Columns are the union of the offer fields present in the response, plus `query` first and `source`, `country`, `fetched_at` last (all four taken from the job result, never from an offer). Results carrying no offers (`not_found`, `error`) produce no rows; `X-Offer-Rows` reports the row count so an empty export is distinguishable from a broken one. UTF-8 with a BOM and CRLF line endings, RFC 4180 quoting. Settles exactly as the JSON poll does.



## OpenAPI

````yaml /price-data/openapi.json get /api/jobs/{jobId}/csv
openapi: 3.1.0
info:
  title: Price Data API
  version: 1.0.0
  description: >-
    The PricePirate Price Data API: asynchronous price and offer lookups across
    Idealo, Toppreise, Klarna, PriceRunner and Allegro. Create a job, poll it,
    read the results. Authenticated with your enterprise API key via the
    x-api-key header.
servers:
  - url: https://api-v2.pricepirate.com
    description: Production
security: []
paths:
  /api/jobs/{jobId}/csv:
    get:
      tags:
        - Jobs
      summary: Poll a job as CSV
      description: >-
        The same job view as `GET /api/jobs/{jobId}`, flattened to CSV with
        **one row per offer**. Columns are the union of the offer fields present
        in the response, plus `query` first and `source`, `country`,
        `fetched_at` last (all four taken from the job result, never from an
        offer). Results carrying no offers (`not_found`, `error`) produce no
        rows; `X-Offer-Rows` reports the row count so an empty export is
        distinguishable from a broken one. UTF-8 with a BOM and CRLF line
        endings, RFC 4180 quoting. Settles exactly as the JSON poll does.
      parameters:
        - name: jobId
          in: path
          required: true
          schema:
            type: string
        - name: delimiter
          in: query
          required: false
          description: >-
            Field separator. Default `,`; use `;` or `tab` for spreadsheet
            locales that do not split on commas.
          schema:
            type: string
            enum:
              - ','
              - ;
              - tab
            default: ','
      responses:
        '200':
          description: Terminal job rendered as CSV, one row per offer
          headers:
            Content-Disposition:
              description: '`attachment; filename="job-<jobId>.csv"`'
              schema:
                type: string
            X-Offer-Rows:
              description: Number of data rows, excluding the header
              schema:
                type: integer
          content:
            text/csv:
              schema:
                type: string
        '400':
          description: Unsupported `delimiter`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: >-
            Unknown job, a job created with a different API key, or a job aged
            out of retention
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '409':
          description: >-
            Job is still pending — a CSV cannot say so, and partial rows would
            read as a complete answer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '502':
          description: Service temporarily unavailable; retry later
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ErrorBody:
      type: object
      properties:
        error:
          type: boolean
          enum:
            - true
        message:
          type: string
      required:
        - error
        - message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````