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

# Preconfigured query

> - `market`: the market node with all its columns
- `relations`: every relation to or from the market (`src`, `dst`, relation fields, and the peer's `peer_id`, `peer_platform`, `peer_title`, `peer_status`, `peer_url`)
- `underlying`: all markets on the same underlying, with `direction`, `lo`, `hi`
- `outcome_set`: all markets in the same outcome set, with the set's `kind` and `members`




## OpenAPI

````yaml /openapi-market-graph.yaml get /api/graph/q/{name}
openapi: 3.1.0
info:
  title: Probalytics Market Graph API
  description: >
    Read-only queries over the market relations graph (Kalshi + Polymarket).

    See [Market Graph](/docs/market-graph) for the schema and relation
    semantics.


    The market graph is an **early access** feature. Requests from accounts
    without access

    return `403`. To request access, email support@probalytics.io.


    ```

    Authorization: Bearer <credential_id>:<credential_secret>

    ```
  version: 0.1.0
  contact:
    name: Probalytics Support
    url: https://probalytics.io
    email: support@probalytics.io
servers:
  - url: https://api.probalytics.io
    description: Production
security:
  - apiKey: []
tags:
  - name: Market Graph
    description: Relations between markets, queried by market ID or with Cypher.
paths:
  /api/graph/q/{name}:
    get:
      tags:
        - Market Graph
      summary: Preconfigured query
      description: >
        - `market`: the market node with all its columns

        - `relations`: every relation to or from the market (`src`, `dst`,
        relation fields, and the peer's `peer_id`, `peer_platform`,
        `peer_title`, `peer_status`, `peer_url`)

        - `underlying`: all markets on the same underlying, with `direction`,
        `lo`, `hi`

        - `outcome_set`: all markets in the same outcome set, with the set's
        `kind` and `members`
      operationId: graphNamedQuery
      parameters:
        - name: name
          in: path
          required: true
          schema:
            type: string
            enum:
              - market
              - relations
              - underlying
              - outcome_set
        - name: id
          in: query
          required: true
          description: Market ID (the `id` column of `markets`).
          schema:
            type: string
            format: uuid
      responses:
        '200':
          $ref: '#/components/responses/Rows'
        '400':
          $ref: '#/components/responses/QueryError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/ValidationError'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  responses:
    Rows:
      description: Query result.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Rows'
    QueryError:
      description: >-
        The query was rejected or failed (syntax error, forbidden statement, too
        many rows).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Detail'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Market graph access is not included in your plan.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationError:
      description: Malformed request (unknown query name, missing `id`, invalid body).
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: array
                items:
                  type: object
    Unavailable:
      description: The graph is not loaded yet. Retry shortly.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Detail'
  schemas:
    Rows:
      type: object
      required:
        - rows
      properties:
        rows:
          type: array
          description: One object per result row, keyed by the `RETURN` column names.
          items:
            type: object
            additionalProperties: true
    Detail:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
          description: Human-readable error message.
    Error:
      type: object
      required:
        - data
        - message
        - status
      properties:
        status:
          type: integer
          description: HTTP status code.
        message:
          type: string
          description: Human-readable error message.
        data:
          type: object
          description: Additional error details.
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >
        API key in the format `credential_id:credential_secret`.


        Example: `Authorization: Bearer
        api_brave_cosmic_falcon:sk_life_AbCdEfGh...`

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.