Get your API key, make your first request, and start exploring unified prediction market data from Kalshi and Polymarket.
Step 1: Get your API key
Create an API key through the Pear dashboard or the Swagger UI at http://localhost:8000/docs.
Your key will look like this:
mk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
Store your API key securely. It is only shown once when created and cannot be retrieved later.
Step 2: Make your first request
Search for prediction markets on any topic. Let’s find events related to Bitcoin.
curl -X GET "http://localhost:8000/api/search?q=bitcoin&limit=3" \
-H "Authorization: Bearer mk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
You will get back matching events:
{
"data" : [
{
"id" : "pear_a1b2c3d4" ,
"slug" : "bitcoin-100k-2025" ,
"title" : "Bitcoin to reach $100K in 2025" ,
"category" : "Crypto" ,
"source_type" : "matched" ,
"venue_event_ids" : {
"kalshi" : "BTC-100K-2025" ,
"polymarket" : "0xbtc100k"
}
}
],
"total_count" : 1
}
Step 3: Get event details with markets
Use the event slug to fetch the full event along with its tradeable markets from each venue.
curl -X GET "http://localhost:8000/api/events/bitcoin-100k-2025" \
-H "Authorization: Bearer mk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
The response includes pricing data from each platform:
{
"id" : "pear_a1b2c3d4" ,
"slug" : "bitcoin-100k-2025" ,
"title" : "Bitcoin to reach $100K in 2025" ,
"category" : "Crypto" ,
"source_type" : "matched" ,
"venue_event_ids" : {
"kalshi" : "BTC-100K-2025" ,
"polymarket" : "0xbtc100k"
},
"markets" : [
{
"venue" : "kalshi" ,
"venue_market_id" : "BTC-100K-2025-YES" ,
"title" : "Bitcoin $100K - Yes" ,
"mid_price" : 0.42 ,
"best_bid" : 0.41 ,
"best_ask" : 0.43 ,
"spread" : 0.02 ,
"volume" : 1200000 ,
"volume_24h" : 89000 ,
"status" : "active"
},
{
"venue" : "polymarket" ,
"venue_market_id" : "0xbtc100k-yes" ,
"title" : "Bitcoin to $100K in 2025?" ,
"mid_price" : 0.44 ,
"best_bid" : 0.43 ,
"best_ask" : 0.45 ,
"spread" : 0.02 ,
"volume" : 2340000 ,
"volume_24h" : 156000 ,
"status" : "active"
}
]
}
Notice the price difference between platforms — Kalshi shows 0.42 while Polymarket shows 0.44. The Comparisons API helps you systematically find these discrepancies.
Step 4: Explore categories
See all available event categories and how many events each has.
curl -X GET "http://localhost:8000/api/events/categories" \
-H "Authorization: Bearer mk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
[
{ "category" : "Sports" , "count" : 2847 },
{ "category" : "Elections" , "count" : 1923 },
{ "category" : "Politics" , "count" : 1654 },
{ "category" : "Economics" , "count" : 1432 },
{ "category" : "Crypto" , "count" : 1198 },
{ "category" : "Entertainment" , "count" : 987 }
]
Step 5: Check your rate limits
Every response includes rate limit headers. You can also check your current status directly.
curl -X GET "http://localhost:8000/api/users/me/rate-limit" \
-H "Authorization: Bearer mk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
{
"plan" : "free" ,
"limit" : 60 ,
"remaining" : 54 ,
"reset" : 1705500000 ,
"window" : "1m"
}
Next steps
Authentication Learn about API key scopes, multiple keys, and security best practices.
Events guide Understand the unified event model and how data is organized.
Comparisons Find pricing discrepancies across platforms with cross-platform mappings.
API Reference Full reference for every endpoint, parameter, and response field.