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

# Cypher query

> One read statement per request; `COPY`, `LOAD`, `CALL`, `INSTALL`, `EXPORT`, and writes are rejected.
Results are capped at 10,000 rows, queries at 10,000 characters, and execution at 30 seconds.
`UNION ALL` is not supported; run separate queries instead.




## OpenAPI

````yaml /openapi-market-graph.yaml post /api/graph/cypher
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/cypher:
    post:
      tags:
        - Market Graph
      summary: Cypher query
      description: >
        One read statement per request; `COPY`, `LOAD`, `CALL`, `INSTALL`,
        `EXPORT`, and writes are rejected.

        Results are capped at 10,000 rows, queries at 10,000 characters, and
        execution at 30 seconds.

        `UNION ALL` is not supported; run separate queries instead.
      operationId: graphCypher
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CypherRequest'
      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'
        '429':
          description: >-
            Another Cypher query is running and this one waited past the
            timeout. Retry with backoff.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  schemas:
    CypherRequest:
      type: object
      required:
        - query
      properties:
        query:
          type: string
          maxLength: 10000
          description: One read-only Cypher statement. Reference parameters as `$name`.
          example: >-
            MATCH (m:Market {id: $id})-[r:RELATION]->(b:Market) RETURN b.id AS
            id, r.relation AS relation
        params:
          type: object
          additionalProperties: true
          default: {}
          description: Query parameters.
          example:
            id: 01234567-89ab-cdef-0123-456789abcdef
    Detail:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
          description: Human-readable error message.
    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
    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.
  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'
  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.