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

# market

> Rank origin markets feeding a destination

Ranks origin markets by current demand share (a point-in-time snapshot). Requires `destination`. Optional `origin_country` (a `Country:<code>` selector, allowed only with `level=city`) narrows the ranking to that country’s origin cities.


## OpenAPI

````yaml api-reference/public-api.yaml GET /v1/market
openapi: 3.0.0
info:
  title: Jinko Public API
  version: 0.1.0
  description: >-
    Curated public REST surface for Jinko. Authenticated with jnk_ API keys. See
    https://docs.gojinko.com for guides.


    ### Per-end-user attribution


    On booking calls you may send an optional `X-End-User-Id` request header to
    attribute the booking to one of your own end users (for per-end-user
    attribution and rate-limiting). The value is an **opaque, tenant-scoped**
    identifier that you choose — not a Jinko account id. Omit it to book as the
    tenant. WorkOS-shaped values (prefixed `user_` or `org_`) are rejected.
servers: []
security: []
paths:
  /v1/market:
    get:
      tags:
        - Demand
      summary: Rank origin markets feeding a destination
      description: >-
        Ranks origin markets by current demand share (a point-in-time snapshot).
        Requires `destination`. Optional `origin_country` (a `Country:<code>`
        selector, allowed only with `level=city`) narrows the ranking to that
        country’s origin cities.
      parameters:
        - schema:
            type: string
            minLength: 1
            description: Destination selector `<Level>:<Code>`. Required for this endpoint.
            example: City:PAR
          required: true
          name: destination
          in: query
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
            description: >-
              Start of the departure window (YYYY-MM-DD). Supply together with
              departure_date_to; omit both for no departure-date filter (all
              departure dates).
            example: '2026-07-01'
          required: false
          name: departure_date_from
          in: query
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
            description: >-
              End of the departure window (YYYY-MM-DD). Supply together with
              departure_date_from; omit both for no departure-date filter (all
              departure dates).
            example: '2026-07-31'
          required: false
          name: departure_date_to
          in: query
        - schema:
            type: string
            enum:
              - Solo
              - Couple
              - Group
              - Family
            example: Couple
          required: false
          name: traveler_type
          in: query
        - schema:
            type: string
            enum:
              - One-Way
              - Round-Trip
            example: Round-Trip
          required: false
          name: trip_type
          in: query
        - schema:
            type: integer
            nullable: true
            minimum: 0
            description: >-
              Minimum trip length in nights (return_date − dep_date).
              Round-trips only.
            example: 5
          required: false
          name: trip_duration_min
          in: query
        - schema:
            type: integer
            nullable: true
            minimum: 0
            description: Maximum trip length in nights (must be >= trip_duration_min).
            example: 9
          required: false
          name: trip_duration_max
          in: query
        - schema:
            type: integer
            nullable: true
            minimum: 0
            description: >-
              Minimum advance-purchase window in days (dep_date − search_date):
              keep demand from searches made at least this many days before
              departure.
            example: 7
          required: false
          name: search_window_min
          in: query
        - schema:
            type: integer
            nullable: true
            minimum: 0
            description: >-
              Maximum advance-purchase window in days (must be >=
              search_window_min).
            example: 30
          required: false
          name: search_window_max
          in: query
        - schema:
            type: integer
            minimum: 2
            maximum: 90
            description: >-
              Number of most-recent days of search activity aggregated into the
              demand level (min 2, default 7, max 90 — a 1-day window is the
              current day, whose data is incomplete; the cube retains 90 days).
            example: 30
          required: false
          name: snapshot_window_days
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 20
            description: Maximum number of result rows. Default 20, max 200.
            example: 20
          required: false
          name: limit
          in: query
        - schema:
            type: string
            enum:
              - country
              - city
            description: >-
              Ranked output granularity: country (default) or city. Applies to
              destination/market (not audience).
            example: city
          required: false
          name: level
          in: query
        - schema:
            type: string
            description: >-
              Origin country selector `Country:<code>` (e.g. `Country:US`).
              Optional and allowed ONLY together with level=city: it scopes the
              ranked origin markets to a single country so that country’s cities
              are ranked. Must be a country — a City selector is rejected.
            example: Country:US
          required: false
          name: origin_country
          in: query
      responses:
        '200':
          description: Market demand ranking
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: BAD_REQUEST
                  message: Malformed JSON in request body.
                  doc_url: https://docs.gojinko.com/concepts/errors
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: AUTH_REQUIRED
                  message: Invalid or expired API key.
                  doc_url: https://docs.gojinko.com/api-reference/authentication
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: BAD_REQUEST
                  message: >-
                    origins: origins is required; trip_type: trip_type is
                    required
                  doc_url: https://docs.gojinko.com/concepts/errors
        '429':
          description: Rate limit or quota exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: RATE_LIMITED
                  message: Rate limit or quota exceeded.
                  doc_url: https://docs.gojinko.com/concepts/errors
        '502':
          description: Upstream service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: UPSTREAM_ERROR
                  message: Upstream travel provider returned an error. Please retry.
                  doc_url: https://docs.gojinko.com/concepts/errors
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
components:
  schemas:
    MarketResponse:
      type: object
      properties:
        rows:
          type: array
          items:
            $ref: '#/components/schemas/MarketSnapshotRow'
      required:
        - rows
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            doc_url:
              type: string
          required:
            - code
            - message
      required:
        - error
    MarketSnapshotRow:
      type: object
      properties:
        rank:
          type: number
          example: 1
        market:
          type: string
          example: Country:US
        share:
          type: number
          example: 0.214
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
    BearerAuth:
      type: http
      scheme: bearer

````