- By Slug — Best for fetching specific individual markets or events
- By Tags — Ideal for filtering markets by category or sport
- Via Events Endpoint — Most efficient for retrieving all active markets
Fetch by Slug
Use case: When you need to retrieve a specific market or event that you already know about. Individual markets and events are best fetched using their unique slug identifier. The slug can be found directly in the Polymarket frontend URL.How to Extract the Slug
From any Polymarket URL, the slug is the path segment after/event/:
Examples
Fetch by Tags
Use case: When you want to filter markets by category, sport, or topic. Tags provide a way to categorize and filter markets. You can discover available tags and then use them to filter your requests.Discover Available Tags
General tags:GET /tags (Gamma API)
Sports tags and metadata: GET /sports (Gamma API)
The /sports endpoint returns metadata for sports including tag IDs, images, resolution sources, and series information.
Filter by Tag
Once you have tag IDs, use thetag_id parameter in both events and markets endpoints:
Additional Tag Filtering
You can also:- Use
related_tags=trueto include related tag markets - Exclude specific tags with
exclude_tag_id
Fetch All Active Markets
Use case: When you need to retrieve all available active markets, typically for broader analysis or market discovery. The most efficient approach is to use the events endpoint withactive=true&closed=false, as events contain their associated markets.
Key Parameters
| Parameter | Description |
|---|---|
order | Field to order by (volume_24hr, volume, liquidity, start_date, end_date, competitive, closed_time) |
ascending | Sort direction (true for ascending, false for descending). Default: false |
active | Filter by active status (true for live tradable events) |
closed | Filter by closed status |
limit | Results per page |
offset | Number of results to skip for pagination |
Pagination
All list endpoints return paginated responses withlimit and offset parameters:
Best Practices
- For individual markets: Use the slug method for direct lookups
- For category browsing: Use tag filtering to reduce API calls
- For complete market discovery: Use the events endpoint with pagination
- Always include
active=true&closed=falseunless you specifically need historical data - Use the events endpoint and work backwards — events contain their associated markets, reducing the number of API calls needed