Both the getEvents and getMarkets are paginated. See pagination section for details.
Overview
There are three main strategies for retrieving market data:- 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
1. 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/
or /market/
:
API Endpoints
For Events: GET /events/slug/ For Markets: GET /markets/slug/Examples
2. Fetch by Tags
Use Case: When you want to filter markets by category, sport, or topic. Tags provide a powerful way to categorize and filter markets. You can discover available tags and then use them to filter your market requests.Discover Available Tags
General Tags: GET /tags Sports Tags & Metadata: GET /sports The/sports
endpoint returns comprehensive metadata for sports including tag IDs, images, resolution sources, and series information.
Using Tags in Market Requests
Once you have tag IDs, you can use them with thetag_id
parameter in both markets and events endpoints.
Markets with Tags: GET /markets
Events with Tags: GET /events
Additional Tag Filtering
You can also:- Use
related_tags=true
to include related tag markets - Exclude specific tags with
exclude_tag_id
3. 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 and work backwards, as events contain their associated markets.
Events Endpoint: GET /events
Markets Endpoint: GET /markets
Key Parameters
order=id
- Order by event IDascending=false
- Get newest events firstclosed=false
- Only active marketslimit
- Control response sizeoffset
- For pagination
Examples
Pagination
For large datasets, use pagination withlimit
and offset
parameters:
limit=50
- Return 50 results per pageoffset=0
- Start from the beginning (increment by limit for subsequent pages)
Best Practices
- For Individual Markets: Always use the slug method for best performance
- For Category Browsing: Use tag filtering to reduce API calls
- For Complete Market Discovery: Use the events endpoint with pagination
- Always Include
closed=false
: Unless you specifically need historical data - Implement Rate Limiting: Respect API limits for production applications
Related Endpoints
- Get Markets - Full markets endpoint documentation
- Get Events - Full events endpoint documentation
- Search Markets - Search functionality