π² betPlace Quickstart
Create one-click betting links that pre-fill betslips on any sportsbook
betPlace Quickstart Guide
betPlace enables one-click bet placement by generating deep links that pre-fill betslips on sportsbooks. Perfect for affiliate sites, pick sharing platforms, and bet recommendation apps that want to monetize through commissions.
What's Included
See subscription pricing β for current rates.
- β Includes all betPrices features (real-time odds from 20+ sportsbooks)
- β Automatic betslip creation with one click
- β Works on web and mobile (detects platform automatically)
- β Parlay support (multiple picks in one link)
- β Alternate line support
- β Attribution tracking and reporting
- β Affiliate commission optimization
Prerequisites
- SharpSports account (sign up here)
- betPlace subscription (see pricing) - includes betPrices
- Your API keys (found in dashboard)
How It Works
betPlace links redirect users to their sportsbook with betslips pre-filled:
- You create a context with market selections and sportsbook
- SharpSports generates a link (e.g.,
https://sharpsports.io/bet/abc123) - User clicks the link on your site
- User lands at sportsbook with betslip already filled out
- You earn commission when user places the bet
5-Minute Quickstart
Step 1: Set Up Your Environment
import requests
import json
# Use your public key for creating contexts (frontend-safe)
PUBLIC_KEY = "pk_test_your_key_here" # Use pk_live_ in production
# Use private key for fetching data (backend only)
PRIVATE_KEY = "sk_test_your_key_here" # Use sk_live_ in production
public_headers = {
"Authorization": f"Token {PUBLIC_KEY}",
"Content-Type": "application/json"
}
private_headers = {
"Authorization": f"Token {PRIVATE_KEY}",
"Content-Type": "application/json"
}
base_url = "https://api.sharpsports.io/v1"Step 2: Find a Market Selection
Use your private key to find markets to link to:
def find_market_selections(event_id, proposition="spread"):
"""Find market selections for an event (use private key)"""
response = requests.get(
f"{base_url}/marketSelections",
headers=private_headers,
params={
"eventId": event_id,
"proposition": proposition,
"prices": "true" # Include current odds
}
)
selections = response.json()
print(f"Found {len(selections)} {proposition} markets:\n")
for sel in selections:
print(f"Market: {sel['id']}")
print(f" Position: {sel['position']}")
if 'prices' in sel and sel['prices']:
best = sel['prices'][0]
print(f" Best line: {best['line']} ({best['odds']}) @ {best['book']['abbr']}")
return selections
# Example: Find spread markets for an event
event_id = "EVNT_abc123def456789012345678901234"
selections = find_market_selections(event_id, "spread")Step 3: Create a betPlace Link
Use your public key to create a context with a betPlace link:
def create_betplace_link(market_selection_ids, book="dk", region="nj"):
"""Create a betPlace link (use public key)"""
response = requests.post(
f"{base_url}/context",
headers=public_headers,
json={
"marketSelections": market_selection_ids,
"book": book,
"region": region
}
)
context = response.json()
print(f"\nβ
betPlace link created!")
print(f"Link: {context['url']}")
print(f"Context ID: {context['id']}")
print(f"Expires: {context['expiresAt']}")
return context
# Create a link for a single pick
market_id = "MRKT_abc123def456789012345678901234"
context = create_betplace_link([market_id], book="dk", region="nj")
# Share this link with your users:
# https://sharpsports.io/bet/{context_id}Step 4: Create a Parlay Link
Create links for multiple picks (parlays):
def create_parlay_link(market_ids, book="fd", region="nj"):
"""Create a parlay betPlace link"""
response = requests.post(
f"{base_url}/context",
headers=public_headers,
json={
"marketSelections": market_ids,
"book": book,
"region": region
}
)
context = response.json()
print(f"\nπ― Parlay link created!")
print(f"Link: {context['url']}")
print(f"Legs: {len(market_ids)}")
return context
# Create a 3-leg parlay
parlay_picks = [
"MRKT_abc123def456789012345678901234",
"MRKT_def456abc789012345678901234567",
"MRKT_ghi789def012345678901234567890"
]
parlay = create_parlay_link(parlay_picks, book="fd", region="nj")Step 5: Display Links on Your Site
Here's a complete example for an odds comparison site:
def create_odds_table_with_links(event_id, region="nj"):
"""Create odds table with betPlace links for each book"""
# 1. Get market selections with prices
response = requests.get(
f"{base_url}/marketSelections",
headers=private_headers,
params={
"eventId": event_id,
"proposition": "spread",
"prices": "true"
}
)
selections = response.json()
# Get event details
event = requests.get(
f"{base_url}/events/{event_id}",
headers=private_headers
).json()
print(f"\nπ {event['name']}")
print("-" * 60)
# 2. For each selection, show prices with betPlace links
for selection in selections:
print(f"\n{selection['position']} {selection['line']:+.1f}")
for price in selection.get('prices', [])[:5]:
book = price['book']['abbr']
odds = price['odds']
# Create betPlace link for this specific book
context = requests.post(
f"{base_url}/context",
headers=public_headers,
json={
"marketSelections": [selection['id']],
"book": book,
"region": region
}
).json()
link = context['url']
print(f" {book.upper():8} {odds:+4d} β {link}")
# Display odds with betPlace links
create_odds_table_with_links("EVNT_abc123def456789012345678901234", region="nj")Complete Working Example
Here's a full implementation for a pick sharing platform:
import requests
from datetime import datetime
class BetPlaceClient:
def __init__(self, public_key, private_key):
self.public_key = public_key
self.private_key = private_key
self.base_url = "https://api.sharpsports.io/v1"
self.public_headers = {
"Authorization": f"Token {public_key}",
"Content-Type": "application/json"
}
self.private_headers = {
"Authorization": f"Token {private_key}",
"Content-Type": "application/json"
}
def find_best_line(self, player_id, proposition="player_points"):
"""Find the best available line for a player prop"""
response = requests.get(
f"{self.base_url}/marketSelections",
headers=self.private_headers,
params={
"player": player_id,
"proposition": proposition,
"upcoming": "true",
"prices": "true",
"limit": 1
}
)
selections = response.json()
if not selections:
return None
selection = selections[0]
prices = selection.get('prices', [])
if not prices:
return None
# Find best odds
best = max(prices, key=lambda p: p['odds'])
return {
"marketSelectionId": selection['id'],
"player": selection.get('player', {}).get('name'),
"proposition": proposition,
"line": best.get('line'),
"odds": best['odds'],
"book": best['book']['abbr']
}
def create_pick_with_link(self, market_id, book, region="nj"):
"""Create a betPlace link for a pick"""
response = requests.post(
f"{self.base_url}/context",
headers=self.public_headers,
json={
"marketSelections": [market_id],
"book": book,
"region": region
}
)
return response.json()
def share_pick(self, player_id, proposition, region="nj"):
"""Complete workflow: Find best line and create shareable link"""
# 1. Find best available line
best = self.find_best_line(player_id, proposition)
if not best:
print("No markets available")
return None
print(f"π Best Line Found:")
print(f" Player: {best['player']}")
print(f" Prop: {proposition}")
print(f" Line: {best['line']}")
print(f" Odds: {best['odds']:+d}")
print(f" Book: {best['book'].upper()}")
# 2. Create betPlace link
context = self.create_pick_with_link(
best['marketSelectionId'],
best['book'],
region
)
print(f"\nβ
Share this link:")
print(f" {context['url']}")
return {
"pick": best,
"link": context['url'],
"contextId": context['id']
}
# Usage
client = BetPlaceClient(
public_key="pk_test_your_key_here",
private_key="sk_test_your_key_here"
)
# Share a player prop pick
pick = client.share_pick(
player_id="PLYR_abc123def456789012345678901234",
proposition="player_points",
region="nj"
)Understanding the Data
Object ID Prefixes
All entities use consistent ID formats:
- Market Selections:
MRKT_+ UUID (example:MRKT_abc123def456789012345678901234) - Contexts: Generated context IDs for betPlace links
- Books:
BOOK_+ UUID (example:BOOK_abc123def456789012345678901234) - Bettor Accounts:
BACT_+ UUID (example:BACT_abc123def456789012345678901234) - Events:
EVNT_+ UUID (example:EVNT_abc123def456789012345678901234) - Players:
PLYR_+ UUID (example:PLYR_abc123def456789012345678901234)
Context Object Structure
{
"id": "abc123def456",
"url": "https://sharpsports.io/bet/abc123def456",
"marketSelections": [
"MRKT_abc123def456789012345678901234"
],
"book": "dk",
"region": "nj",
"createdAt": "2024-01-15T10:30:00Z",
"expiresAt": "2024-01-15T22:30:00Z"
}Supported Sportsbooks
betPlace supports 20+ sportsbooks including:
- DraftKings (
dk) - FanDuel (
fd) - BetMGM (
mgm) - Caesars (
cz) - BetRivers (
br) - PointsBet (
pb) - Barstool (
bs) - And many more...
Supported Regions
nj- New Jerseypa- Pennsylvaniami- Michiganin- Indianail- Illinoisco- Coloradotn- Tennesseeva- Virginia- And all other legal US betting states
Use Cases
1. Affiliate Odds Comparison Site
Display odds from multiple books with bet buttons:
# Show odds table with "Bet Now" links for each book
for price in prices:
context = create_betplace_link(
[market_id],
book=price['book']['abbr'],
region=user_region
)
# Display: "Bet at DraftKings: -110 [Bet Now β]"
# Link goes to context['url']2. Pick Sharing Platform
Let users share their bets with followers:
# User makes a pick
user_pick = {
"marketSelections": [mrkt1, mrkt2, mrkt3], # Parlay
"book": "dk",
"region": "nj"
}
# Create shareable link
context = create_betplace_link(
user_pick['marketSelections'],
user_pick['book'],
user_pick['region']
)
# Followers can click to tail the bet
print(f"Tail this pick: {context['url']}")3. Bet Recommendation Engine
Automatically create links for AI-generated picks:
# AI identifies value bet
value_bet = find_value_opportunities()
# Create betPlace link for the pick
context = create_betplace_link(
[value_bet['marketSelectionId']],
book=value_bet['bestBook'],
region=user_region
)
# Send to user: "We found value! Bet here: {context['url']}"4. Daily Fantasy Alternative
Create parlays instead of DFS lineups:
# Build optimal parlay from player props
optimal_parlay = [
mrkt_lebron_points,
mrkt_curry_threes,
mrkt_giannis_rebounds
]
# Create one link for all picks
context = create_betplace_link(optimal_parlay, "fd", "nj")
# User clicks once to bet the whole parlayAdvanced Features
Tailing Synced BetSlips
If you also use betSync, users can tail each other's actual bets:
# User has synced their betslip from DraftKings (via betSync)
betslip_id = "SLIP_abc123def456789012345678901234"
# Create betPlace link to tail this exact betslip
response = requests.post(
f"{base_url}/context",
headers=public_headers,
json={
"betSlip": betslip_id, # Use betSlip instead of marketSelections
"book": "dk",
"region": "nj"
}
)
context = response.json()
print(f"Tail this bet: {context['url']}")Alternate Lines
Support alternate spreads and totals:
# Find alternate lines for a market
response = requests.get(
f"{base_url}/marketSelections",
headers=private_headers,
params={
"eventId": event_id,
"proposition": "spread",
"includeAlternates": "true" # Include alt lines
}
)
alternates = response.json()
# Each alternate line has its own marketSelectionId
for alt in alternates:
print(f"Line: {alt['line']:+.1f} β Market ID: {alt['id']}")
# Create link for specific alternate line
context = create_betplace_link([alt['id']], "dk", "nj")Attribution Tracking
Track which links convert to bets:
# Add custom tracking parameter (optional)
response = requests.post(
f"{base_url}/context",
headers=public_headers,
json={
"marketSelections": [market_id],
"book": "dk",
"region": "nj",
"metadata": {
"campaign": "newsletter_2024_01",
"source": "email",
"influencer": "user_123"
}
}
)
# Check attribution in dashboard analyticsMobile vs Web Detection
betPlace automatically detects platform and routes appropriately:
- Mobile web browser: Redirects to app if installed, otherwise app store or mobile web
- Desktop browser: Redirects to sportsbook website
- In-app webview: Opens sportsbook app directly
No additional code needed - the same link works everywhere.
betPlace vs betPrices
betPlace includes all betPrices features plus deep linking. See pricing details β.
| Feature | betPrices | betPlace |
|---|---|---|
| Real-time odds | β | β Included |
| Market data | β | β Included |
| Historical pricing | β Requires historicData | β Requires historicData |
| Deep linking | β | β |
| Attribution tracking | β | β |
| Affiliate commissions | β | β |
| One-click betting | β | β |
When to choose betPlace:
- You want to monetize through affiliates
- You need "Bet Now" buttons
- You're building a pick sharing platform
- You want to drive conversions, not just display odds
When betPrices is enough:
- Pure odds comparison/display
- Analytics and research tools
- No bet placement needed
Rate Limits
betPlace has the same rate limits as betPrices:
- 10 requests/second with public key (context creation)
- 100 requests/second with private key (data fetching)
- Unlimited daily requests
Integration with Other Products
betPlace + betSync
Combine bet tracking with bet placement:
# 1. User syncs their bet history (betSync)
betslips = get_user_betslips(bettor_id)
# 2. Display their bets with "Tail" buttons (betPlace)
for betslip in betslips:
if betslip['status'] == 'won':
# Create tail link for this winning bet
context = create_betplace_link(
betslip['marketSelections'],
betslip['book'],
region
)
print(f"This bet won! Tail it: {context['url']}")betPlace + historicData
Use analytics to create high-value picks:
# 1. Find favorable matchup with historicData
dvp = get_dvp_rankings(position="PG", metric="points")
weak_defense = dvp[0] # Worst defense against PGs
# 2. Get prop line for player facing weak defense
props = find_player_props(player_id, opponent=weak_defense['team']['id'])
# 3. Create betPlace link for the value bet
context = create_betplace_link([props[0]['id']], "dk", "nj")
print(f"Value bet identified! {context['url']}")Book Compatibility
Not all markets are available on all books. See Book Compatibility for details on:
- Which props each book supports
- League-specific availability
- Parlay restrictions
- Alternate line support
Next Steps
- Explore market types: Try different propositions (spreads, totals, props)
- Test regions: Create links for different states
- Build attribution: Track which links convert best
- Monetize: Join sportsbook affiliate programs to earn commissions
Need Help?
- π§ Support: [email protected]
- π Full Documentation:
- π¬ Discord: Join our developer community
Updated 4 months ago