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.
Using with Swagger UI
You can view the spec interactively using the online Swagger Editor:
- Go to editor.swagger.io
- 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
- Open Postman
- Click Import (top-left)
- Select the downloaded JSON file
- The collection will appear with all endpoints organized by category
Importing into Insomnia
- Open Insomnia
- Click Import from the dashboard or File > Import
- Select the downloaded JSON file
- All requests will be imported
Collection Variables
After importing, update these variables with your values:
| Variable | Description | Default |
|---|---|---|
baseUrl | API base URL | https://polymarket.sandbox.playbatman.com |
apiKey | Your operator API key | your-api-key |
marketId | Auto-populated on market creation | — |
outcomeId | Auto-populated on market creation | — |
orderId | Auto-populated on order placement | — |
categoryId | Set manually after creating a category | — |
Auto-populated Variables
The collection includes test scripts that automatically set variables:
- Create Market sets
marketIdandoutcomeIdfrom the response - Place Order sets
orderIdfrom 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:
| Folder | Requests |
|---|---|
| Health | Health Check, Ready Check |
| Categories | Create, List, Get |
| Markets | Create, List, Get, Update, Open, Suspend, Resume, Close, Resolve, Cancel |
| Orders | Place (Limit Buy, Limit Sell, Market Buy), Get, List, List by Player, Cancel |
| Positions | Get All, Get by Market |
| Trades | List All, List by Market |
| Market Data | Order Book, Market Prices, Outcome Price |
| Stats | Overview |
| Settlements | Settle, Status, Retry, Get All, Get by Market |