Skip to main content

OpenAPI Specification & API Collections

OpenAPI 3.0

The full OpenAPI 3.0 specification is available for download. You can use it with tools like Swagger UI, Redocly, or any OpenAPI-compatible tooling.

Download openapi.yaml

Using with Swagger UI

You can view the spec interactively using the online Swagger Editor:

  1. Go to editor.swagger.io
  2. Click File > Import URL or paste the contents of the YAML file

Using with Redocly

npx @redocly/cli preview-docs openapi.yaml

Postman / Insomnia Collection

A pre-built collection with all API endpoints is available for import into Postman or Insomnia.

Download prediction-market-api.postman_collection.json

Importing into Postman

  1. Open Postman
  2. Click Import (top-left)
  3. Select the downloaded JSON file
  4. The collection will appear with all endpoints organized by category

Importing into Insomnia

  1. Open Insomnia
  2. Click Import from the dashboard or File > Import
  3. Select the downloaded JSON file
  4. All requests will be imported

Collection Variables

After importing, update these variables with your values:

VariableDescriptionDefault
baseUrlAPI base URLhttps://polymarket.sandbox.playbatman.com
apiKeyYour operator API keyyour-api-key
marketIdAuto-populated on market creation
outcomeIdAuto-populated on market creation
orderIdAuto-populated on order placement
categoryIdSet manually after creating a category

Auto-populated Variables

The collection includes test scripts that automatically set variables:

  • Create Market sets marketId and outcomeId from the response
  • Place Order sets orderId from the response

This lets you run requests in sequence without manually copying IDs.

Request Organization

The collection is organized into folders matching the API sections:

FolderRequests
HealthHealth Check, Ready Check
CategoriesCreate, List, Get
MarketsCreate, List, Get, Update, Open, Suspend, Resume, Close, Resolve, Cancel
OrdersPlace (Limit Buy, Limit Sell, Market Buy), Get, List, List by Player, Cancel
PositionsGet All, Get by Market
TradesList All, List by Market
Market DataOrder Book, Market Prices, Outcome Price
StatsOverview
SettlementsSettle, Status, Retry, Get All, Get by Market