> ## 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

> Poll a job until its status is `completed` or `failed`. Results are retained for about an hour after completion, so fetch them within that window. Jobs are only visible to the API key that created them.



## OpenAPI

````yaml /price-data/openapi.json get /api/jobs/{jobId}
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}:
    get:
      tags:
        - Jobs
      summary: Poll a job
      description: >-
        Poll a job until its status is `completed` or `failed`. Results are
        retained for about an hour after completion, so fetch them within that
        window. Jobs are only visible to the API key that created them.
      parameters:
        - name: jobId
          in: path
          required: true
          schema:
            type: string
        - name: omit_partials
          in: query
          required: false
          description: >-
            When `1` / `true` / `yes`, `results` comes back empty while `status`
            is `pending` — progress fields (`done` / `total` / `summary`) are
            unaffected, and a terminal poll always carries the full array. Only
            relevant for Idealo search jobs; inert for other sources.
          schema:
            type: string
            example: '1'
      responses:
        '200':
          description: Job view (partial while pending, full when terminal)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayPollJobSuccess'
        '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'
        '502':
          description: Service temporarily unavailable; retry later
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    GatewayPollJobSuccess:
      description: >-
        The job view. Idealo search jobs report progress (`done` / `total` /
        `summary`) and progressive results with classified offers; other sources
        return their results when the job completes.
      oneOf:
        - $ref: '#/components/schemas/IdealoV2PollJobSuccess'
        - $ref: '#/components/schemas/PriceApiPollJobSuccess'
    ErrorBody:
      type: object
      properties:
        error:
          type: boolean
          enum:
            - true
        message:
          type: string
      required:
        - error
        - message
    IdealoV2PollJobSuccess:
      type: object
      properties:
        error:
          type: boolean
          enum:
            - false
        job_id:
          type: string
        status:
          $ref: '#/components/schemas/JobStatus'
        source:
          type: string
        operation:
          type: string
        country:
          type: string
        created_at:
          type: string
        results:
          type: array
          items:
            $ref: '#/components/schemas/IdealoV2JobResultItem'
        done:
          type: integer
          description: >-
            Queries that have reached a terminal result. Counts queries, not
            result items — a `search-by-term` query returning 20 tiles is 1
            done, not 20 — so `done` never exceeds `total`.
        total:
          type: integer
          description: Number of queries the job was created with.
        summary:
          $ref: '#/components/schemas/JobResultsSummary'
      required:
        - error
        - job_id
        - status
        - source
        - operation
        - country
        - created_at
    PriceApiPollJobSuccess:
      type: object
      properties:
        error:
          type: boolean
          enum:
            - false
        job_id:
          type: string
        status:
          $ref: '#/components/schemas/JobStatus'
        source:
          type: string
        operation:
          type: string
        country:
          $ref: '#/components/schemas/SupportedCountry'
        created_at:
          type: string
        results:
          type: array
          items:
            $ref: '#/components/schemas/PriceApiJobResultItem'
      required:
        - error
        - job_id
        - status
        - source
        - operation
        - country
        - created_at
    JobStatus:
      type: string
      enum:
        - pending
        - completed
        - failed
    IdealoV2JobResultItem:
      type: object
      properties:
        query:
          type: string
        status:
          $ref: '#/components/schemas/ResultStatus'
        result:
          $ref: '#/components/schemas/ClassifiedPriceResult'
        error:
          type: string
        errorCode:
          type: string
          enum:
            - invalid_query
            - blocked
            - rate_limited
            - timeout
            - scrape_error
            - internal_error
          description: >-
            Present on error items. `invalid_query` is the caller's fault and
            will fail identically on retry; `blocked`, `timeout`, `scrape_error`
            and `internal_error` are ours and are worth retrying. A product that
            does not exist is not an error — it is `not_found`.
      required:
        - query
        - status
        - result
    JobResultsSummary:
      type: object
      properties:
        found:
          type: integer
        not_found:
          type: integer
        error:
          type: integer
        classifications:
          type: object
          properties:
            same_variant:
              type: integer
            likely_same_variant:
              type: integer
            same_family_different_variant:
              type: integer
            different_product:
              type: integer
            unclear:
              type: integer
            product_page_match:
              type: integer
            multipack:
              type: integer
            bundle:
              type: integer
      required:
        - found
        - not_found
        - error
        - classifications
    SupportedCountry:
      type: string
      enum:
        - at
        - de
        - es
        - fr
        - it
        - uk
        - gb
        - fi
        - ie
        - nl
        - 'no'
        - us
        - se
        - dk
        - be
        - ch
        - pl
        - pt
        - cz
        - hu
        - ro
        - gr
        - sk
        - hr
        - bg
        - au
        - ca
        - br
        - in
        - jp
        - ae
        - cn
        - mx
      description: Marketplace country code when required for the source.
    PriceApiJobResultItem:
      type: object
      properties:
        query:
          type: string
        status:
          $ref: '#/components/schemas/ResultStatus'
        result:
          anyOf:
            - $ref: '#/components/schemas/PriceResult'
            - $ref: '#/components/schemas/IdealoShopResult'
            - type: 'null'
        error:
          type: string
        errorCode:
          type: string
      required:
        - query
        - status
        - result
    ResultStatus:
      type: string
      enum:
        - found
        - not_found
        - error
    ClassifiedPriceResult:
      type:
        - object
        - 'null'
      properties:
        id:
          type: string
        page_type:
          $ref: '#/components/schemas/PageType'
        name:
          type: string
        url:
          type: string
        ean:
          type:
            - string
            - 'null'
        brand:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        image_urls:
          type: array
          items:
            type: string
        review_rating:
          type:
            - number
            - 'null'
        review_count:
          type:
            - number
            - 'null'
        categories:
          type:
            - array
            - 'null'
          items:
            type: string
        category_ids:
          type:
            - array
            - 'null'
          items:
            type: string
        available_since:
          type:
            - string
            - 'null'
        last_updated:
          type:
            - string
            - 'null'
        price_avg:
          type:
            - number
            - 'null'
        price_max:
          type:
            - number
            - 'null'
        price_min:
          type: number
        offers_count:
          type: number
        offers:
          type: array
          items:
            $ref: '#/components/schemas/ClassifiedOffer'
        source:
          type: string
        country:
          type: string
        fetched_at:
          type: string
      required:
        - id
        - name
        - url
        - ean
        - brand
        - description
        - image_urls
        - review_rating
        - review_count
        - categories
        - category_ids
        - price_avg
        - price_max
        - price_min
        - offers_count
        - offers
        - source
        - country
        - fetched_at
    PriceResult:
      type: object
      properties:
        id:
          type: string
        page_type:
          $ref: '#/components/schemas/PageType'
        name:
          type: string
        url:
          type: string
        ean:
          type:
            - string
            - 'null'
        brand:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        image_urls:
          type: array
          items:
            type: string
        review_rating:
          type:
            - number
            - 'null'
        review_count:
          type:
            - number
            - 'null'
        categories:
          type:
            - array
            - 'null'
          items:
            type: string
        category_ids:
          type:
            - array
            - 'null'
          items:
            type: string
        available_since:
          type:
            - string
            - 'null'
        last_updated:
          type:
            - string
            - 'null'
        price_avg:
          type:
            - number
            - 'null'
        price_max:
          type:
            - number
            - 'null'
        price_min:
          type: number
        offers_count:
          type: number
        offers:
          type: array
          items:
            $ref: '#/components/schemas/Offer'
        source:
          type: string
        country:
          $ref: '#/components/schemas/SupportedCountry'
        fetched_at:
          type: string
      required:
        - id
        - name
        - url
        - ean
        - brand
        - description
        - image_urls
        - review_rating
        - review_count
        - categories
        - category_ids
        - price_avg
        - price_max
        - price_min
        - offers_count
        - offers
        - source
        - country
        - fetched_at
    IdealoShopResult:
      type: object
      properties:
        shop:
          type: object
          additionalProperties: {}
        top_products:
          type: array
          items:
            type: object
            additionalProperties: {}
        source:
          type: string
          enum:
            - idealo
        country:
          $ref: '#/components/schemas/PriceApiIdealoCountry'
        fetched_at:
          type: string
      required:
        - shop
        - top_products
        - source
        - country
        - fetched_at
    PageType:
      type: string
      enum:
        - product
        - offers_only
    ClassifiedOffer:
      type: object
      properties:
        title:
          type:
            - string
            - 'null'
        sellerId:
          type: string
        shop_name:
          type: string
        shop_url:
          type:
            - string
            - 'null'
        shop_type:
          type:
            - string
            - 'null'
        marketplace_name:
          type:
            - string
            - 'null'
        shop_review_rating:
          type:
            - number
            - 'null'
        shop_review_count:
          type:
            - number
            - 'null'
        position:
          type: string
        condition:
          type:
            - string
            - 'null'
        currency:
          type: string
        price:
          type: number
        shipping:
          type: number
        total:
          type: number
        free_return:
          type:
            - boolean
            - 'null'
        voucher:
          type: boolean
        availability_code:
          type:
            - string
            - 'null'
        availability_text:
          type:
            - string
            - 'null'
        direct_sale:
          type:
            - boolean
            - 'null'
        classification:
          $ref: '#/components/schemas/OfferClassification'
        confidence:
          $ref: '#/components/schemas/OfferConfidence'
      required:
        - sellerId
        - shop_name
        - shop_url
        - shop_type
        - marketplace_name
        - shop_review_rating
        - shop_review_count
        - position
        - condition
        - currency
        - price
        - shipping
        - total
        - free_return
        - voucher
        - availability_text
        - classification
        - confidence
    Offer:
      type: object
      properties:
        title:
          type:
            - string
            - 'null'
        sellerId:
          type: string
        shop_name:
          type: string
        shop_url:
          type:
            - string
            - 'null'
        shop_type:
          type:
            - string
            - 'null'
        marketplace_name:
          type:
            - string
            - 'null'
        shop_review_rating:
          type:
            - number
            - 'null'
        shop_review_count:
          type:
            - number
            - 'null'
        position:
          type: string
        condition:
          type:
            - string
            - 'null'
        currency:
          type: string
        price:
          type: number
        shipping:
          type: number
        total:
          type: number
        free_return:
          type:
            - boolean
            - 'null'
        voucher:
          type: boolean
        availability_code:
          type:
            - string
            - 'null'
        availability_text:
          type:
            - string
            - 'null'
        direct_sale:
          type:
            - boolean
            - 'null'
      required:
        - sellerId
        - shop_name
        - shop_url
        - shop_type
        - marketplace_name
        - shop_review_rating
        - shop_review_count
        - position
        - condition
        - currency
        - price
        - shipping
        - total
        - free_return
        - voucher
        - availability_text
    PriceApiIdealoCountry:
      type: string
      enum:
        - at
        - de
        - es
        - fr
        - it
        - uk
        - gb
    OfferClassification:
      type:
        - string
        - 'null'
      enum:
        - same_variant
        - likely_same_variant
        - same_family_different_variant
        - different_product
        - unclear
        - product_page_match
        - multipack
        - bundle
        - null
    OfferConfidence:
      type:
        - string
        - 'null'
      enum:
        - high
        - medium
        - low
        - null
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````