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

# Create a job

> Create an asynchronous lookup job. Send `source`, `operation`, `country` and your `queries`; the response contains the job id to poll. Unknown source/operation combinations are rejected with a 400 whose message lists the available catalog.



## OpenAPI

````yaml /price-data/openapi.json post /api/jobs
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:
    post:
      tags:
        - Jobs
      summary: Create a job
      description: >-
        Create an asynchronous lookup job. Send `source`, `operation`, `country`
        and your `queries`; the response contains the job id to poll. Unknown
        source/operation combinations are rejected with a 400 whose message
        lists the available catalog.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/ToppreiseCreateJobBody'
                - $ref: '#/components/schemas/KlarnaCreateJobBody'
                - $ref: '#/components/schemas/PriceRunnerCreateJobBody'
                - $ref: '#/components/schemas/AllegroCreateJobBody'
                - $ref: '#/components/schemas/IdealoV2CreateJobBody'
                - $ref: '#/components/schemas/IdealoShopInfoCreateJobBody'
      responses:
        '200':
          description: Job created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PriceApiCreateJobSuccess'
        '400':
          description: >-
            Malformed body, or a source/operation combination outside the
            catalog (the message enumerates what is available)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '402':
          description: Insufficient credit balance; the response includes a payment link.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditsExhaustedBody'
        '403':
          description: Account suspended, or this endpoint is not enabled for your key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: Concurrent-job or daily query limit reached
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '500':
          description: Job could not be recorded; nothing was billed
          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:
    ToppreiseCreateJobBody:
      type: object
      properties:
        source:
          type: string
          enum:
            - toppreise
          description: Source key.
        operation:
          type: string
          enum:
            - search-by-gtin
          description: Operation name.
        country:
          $ref: '#/components/schemas/ToppreiseCountry'
        queries:
          type: array
          items:
            type: string
          minItems: 1
          description: Non-empty query values.
        condition:
          type: string
      required:
        - source
        - operation
        - queries
        - country
    KlarnaCreateJobBody:
      type: object
      properties:
        source:
          type: string
          enum:
            - klarna
          description: Source key.
        operation:
          type: string
          enum:
            - search-by-gtin
          description: Operation name.
        country:
          $ref: '#/components/schemas/KlarnaCountry'
        queries:
          type: array
          items:
            type: string
          minItems: 1
          description: Non-empty query values.
        condition:
          type: string
      required:
        - source
        - operation
        - queries
        - country
    PriceRunnerCreateJobBody:
      type: object
      properties:
        source:
          type: string
          enum:
            - pricerunner
          description: Source key.
        operation:
          type: string
          enum:
            - search-by-gtin
          description: Operation name.
        country:
          $ref: '#/components/schemas/PriceRunnerCountry'
        queries:
          type: array
          items:
            type: string
          minItems: 1
          description: Non-empty query values.
        condition:
          type: string
      required:
        - source
        - operation
        - queries
        - country
    AllegroCreateJobBody:
      type: object
      properties:
        source:
          type: string
          enum:
            - allegro
          description: Source key.
        operation:
          type: string
          enum:
            - search-by-gtin
          description: Operation name.
        country:
          $ref: '#/components/schemas/AllegroCountry'
        queries:
          type: array
          items:
            type: string
          minItems: 1
          description: Non-empty query values.
        condition:
          type: string
      required:
        - source
        - operation
        - queries
        - country
    IdealoV2CreateJobBody:
      type: object
      properties:
        source:
          type: string
          enum:
            - idealo
          description: Always `idealo` for this service.
        operation:
          $ref: '#/components/schemas/JobOperation'
        country:
          $ref: '#/components/schemas/IdealoV2IdealoCountry'
        queries:
          type: array
          items:
            type: string
          minItems: 1
          maxItems: 1000
          description: >-
            Non-empty queries. Max 1000 per job. Term/URL operations require
            exactly one.
      required:
        - source
        - operation
        - country
        - queries
    IdealoShopInfoCreateJobBody:
      type: object
      properties:
        source:
          type: string
          enum:
            - idealo
          description: Source key.
        operation:
          type: string
          enum:
            - shop-info
          description: Operation name.
        country:
          type: string
          enum:
            - de
          description: Only `de` is supported.
        queries:
          type: array
          items:
            type: string
          minItems: 1
          description: Numeric Idealo shop ids, as strings.
        condition:
          type: string
      required:
        - source
        - operation
        - queries
        - country
    PriceApiCreateJobSuccess:
      type: object
      properties:
        error:
          type: boolean
          enum:
            - false
        job_id:
          type: string
      required:
        - error
        - job_id
    ErrorBody:
      type: object
      properties:
        error:
          type: boolean
          enum:
            - true
        message:
          type: string
      required:
        - error
        - message
    CreditsExhaustedBody:
      type: object
      description: >-
        402 body: the prepaid credit balance cannot cover this job's queries; a
        payment link is included.
      properties:
        error:
          type: boolean
          enum:
            - true
        message:
          type: string
        credits_available:
          type: integer
        credits_required:
          type: integer
        payment_link:
          type:
            - string
            - 'null'
      required:
        - error
        - message
    ToppreiseCountry:
      type: string
      enum:
        - ch
    KlarnaCountry:
      type: string
      enum:
        - at
        - fi
        - fr
        - de
        - ie
        - it
        - nl
        - 'no'
        - es
        - us
        - se
        - dk
        - uk
      description: Marketplace country code for this source.
    PriceRunnerCountry:
      type: string
      enum:
        - uk
        - se
        - dk
      description: Marketplace country code for this source.
    AllegroCountry:
      type: string
      enum:
        - pl
      description: Marketplace country code for this source.
    JobOperation:
      type: string
      enum:
        - search-by-gtin
        - search-by-id
        - search-by-term
        - search-by-url
      description: >-
        `search-by-gtin`: each query is a GTIN of 8–14 digits (bulk OK).
        `search-by-id`: each query is a numeric idealo product id; no LLM
        filter. `search-by-term`: exactly one free-text term. `search-by-url`:
        exactly one product or `q=` search URL; country must match.
    IdealoV2IdealoCountry:
      type: string
      enum:
        - at
        - de
        - es
        - fr
        - it
        - uk
        - gb
      description: Idealo locale. Required for all operations.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````