Pages: 3
URL: llms-txt#example
URL: llms-txt#how-to-fetch-markets
Contents:
Source: https://docs.polymarket.com/developers/gamma-markets-api/fetch-markets-guide
Both the getEvents and getMarkets are paginated. See pagination section for details. This guide covers the three recommended approaches for fetching market data from the Gamma API, each optimized for different use cases.
There are three main strategies for retrieving market data:
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.
From any Polymarket URL, the slug is the path segment after /event/ or /market/:
For Events: GET /events/slug/{slug}
For Markets: GET /markets/slug/{slug}
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.
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.
Once you have tag IDs, you can use them with the tag_id parameter in both markets and events endpoints.
Markets with Tags: GET /markets
Events with Tags: GET /events
related_tags=true to include related tag marketsexclude_tag_idUse 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
order=id - Order by event IDascending=false - Get newest events firstclosed=false - Only active marketslimit - Control response sizeoffset - For paginationThis approach gives you all active markets ordered from newest to oldest, allowing you to systematically process all available trading opportunities.
For large datasets, use pagination with limit and offset parameters:
limit=50 - Return 50 results per pageoffset=0 - Start from the beginning (increment by limit for subsequent pages)Pagination Examples:
**Examples:**
Example 1 (unknown):
unknown https://polymarket.com/event/fed-decision-in-october?tid=1758818660485
↑
Slug: fed-decision-in-october
Example 2 (unknown):
unknown
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.
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.
Once you have tag IDs, you can use them with the tag_id parameter in both markets and events endpoints.
Markets with Tags: GET /markets
Events with Tags: GET /events
Example 3 (unknown):
unknown
You can also:
related_tags=true to include related tag marketsexclude_tag_idUse 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
order=id - Order by event IDascending=false - Get newest events firstclosed=false - Only active marketslimit - Control response sizeoffset - For pagination
Example 4 (unknown):
unknown This approach gives you all active markets ordered from newest to oldest, allowing you to systematically process all available trading opportunities.
For large datasets, use pagination with limit and offset parameters:
limit=50 - Return 50 results per pageoffset=0 - Start from the beginning (increment by limit for subsequent pages)Pagination Examples: ```
URL: llms-txt#market-orders
Contents:
Once you've signed up and deposited funds, you're ready to start trading on Polymarket. Here's a step-by-step guide to get you started.
</p> <h2>Placing a Market Order</h2> <p>_Before trading, you'll want to visit the <a href="https://polymarket.com/markets">markets page</a> to find a market that interests you.</p> <p><Steps> <Steps.Step></p> <pre><code>### [Choose a market](https://polymarket.com/markets) </code></pre> <p>Locate the 'buy' modal, on the right side of the screen. Click the outcome you want to buy (usually Yes or No), then enter the dollar amount you wish to invest. </Steps.Step></p> <p><Steps.Step></p> <pre><code>### Buy shares </code></pre> <p>Click <strong>Buy</strong> and confirm the transaction in your wallet. Once your trade goes through, you'll receive a notification confirming its success.</p> <p><Tip>Congrats, you're officially a Polymarket trader!</Tip> </Steps.Step></p> <p><Steps.Step></p> <pre><code>### Share your bet slip </code></pre> <p>You'll also see a bet slip to share on social media. We love sending \$\$\$ to traders who post their trades on Twitter and tag us! </Steps.Step> </Steps></p> <p>Simple, right? If you think you've got the hang of it, it's time to learn about more advanced trading and order types. <a href="/ka-cn/vibe-coding-cn/src/<a href="/ka-cn/vibe-coding-cn/commit/92c5e47a3fe2422ce46c48acd7b4ae8c07e47f8d"><code>92c5e47a3f</code></a>/skills/polymarket/trading/limit-orders">Limit Orders</a>.</p> <hr>