Skip to content

Commit 475d2c8

Browse files
Mlaz-codeclaude
andcommitted
docs(reference): correct auth labels for /sports, /leagues, /markets, /sportsbooks, /teams
These five endpoints are wrapped in authMiddleware on the server (verified: all return 401 without an API key) but every public-facing surface said otherwise: - 5 MDX files (sports, leagues, markets, sportsbooks, teams) claimed "public endpoint, no authentication required" and showed unauthenticated curl/JS/Python examples - public/openapi.json declared `security: [{}, {ApiKeyHeader: []}]` for each (the empty {} marks auth as optional) and listed no 401 response Updated the MDX callouts to "Requires an API key. Available on all tiers (Free included)." and added the X-API-Key header to every example. In the spec, replaced the security blocks with the global standard set (ApiKeyHeader / BearerAuth / ApiKeyQuery) and added the Unauthorized 401 response. /health and /deeplink/{id} remain genuinely public and were left untouched. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 240bf50 commit 475d2c8

6 files changed

Lines changed: 113 additions & 43 deletions

File tree

content/en/api-reference/leagues.mdx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ GET /api/v1/leagues
1313
```
1414

1515
<Callout type="info">
16-
This is a **public endpoint** -- no authentication required. Unauthenticated requests are rate-limited to 10 requests/minute. Authenticated requests receive your tier's full rate limit.
16+
Requires an API key. Available on all tiers (Free included). Unauthenticated requests return `401`.
1717
</Callout>
1818

1919
## Query Parameters
@@ -27,18 +27,20 @@ This is a **public endpoint** -- no authentication required. Unauthenticated req
2727
<Tabs items={['cURL', 'JavaScript', 'Python']}>
2828
<Tabs.Tab>
2929
```bash
30-
# List all leagues (no auth required)
31-
curl -X GET "https://api.sharpapi.io/api/v1/leagues"
30+
# List all leagues
31+
curl -X GET "https://api.sharpapi.io/api/v1/leagues" \
32+
-H "X-API-Key: YOUR_API_KEY"
3233

3334
# Filter by sport
34-
curl -X GET "https://api.sharpapi.io/api/v1/leagues?sport=basketball"
35+
curl -X GET "https://api.sharpapi.io/api/v1/leagues?sport=basketball" \
36+
-H "X-API-Key: YOUR_API_KEY"
3537
```
3638
</Tabs.Tab>
3739
<Tabs.Tab>
3840
```javascript
39-
// No API key required for public reference endpoints
4041
const response = await fetch(
41-
'https://api.sharpapi.io/api/v1/leagues?sport=basketball'
42+
'https://api.sharpapi.io/api/v1/leagues?sport=basketball',
43+
{ headers: { 'X-API-Key': 'YOUR_API_KEY' } },
4244
);
4345
const { data, meta } = await response.json();
4446

@@ -51,10 +53,10 @@ data.forEach(league => {
5153
```python
5254
import requests
5355

54-
# No API key required
5556
response = requests.get(
5657
'https://api.sharpapi.io/api/v1/leagues',
57-
params={'sport': 'basketball'}
58+
params={'sport': 'basketball'},
59+
headers={'X-API-Key': 'YOUR_API_KEY'},
5860
)
5961
result = response.json()
6062

content/en/api-reference/markets.mdx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ GET /api/v1/markets
1313
```
1414

1515
<Callout type="info">
16-
This is a **public endpoint** -- no authentication required. Unauthenticated requests are rate-limited to 10 requests/minute. Authenticated requests receive your tier's full rate limit.
16+
Requires an API key. Available on all tiers (Free included). Unauthenticated requests return `401`.
1717
</Callout>
1818

1919
## Query Parameters
@@ -27,16 +27,20 @@ This is a **public endpoint** -- no authentication required. Unauthenticated req
2727
<Tabs items={['cURL', 'JavaScript', 'Python']}>
2828
<Tabs.Tab>
2929
```bash
30-
# List all markets (no auth required)
31-
curl -X GET "https://api.sharpapi.io/api/v1/markets"
30+
# List all markets
31+
curl -X GET "https://api.sharpapi.io/api/v1/markets" \
32+
-H "X-API-Key: YOUR_API_KEY"
3233

3334
# Filter by sport
34-
curl -X GET "https://api.sharpapi.io/api/v1/markets?sport=basketball"
35+
curl -X GET "https://api.sharpapi.io/api/v1/markets?sport=basketball" \
36+
-H "X-API-Key: YOUR_API_KEY"
3537
```
3638
</Tabs.Tab>
3739
<Tabs.Tab>
3840
```javascript
39-
const response = await fetch('https://api.sharpapi.io/api/v1/markets');
41+
const response = await fetch('https://api.sharpapi.io/api/v1/markets', {
42+
headers: { 'X-API-Key': 'YOUR_API_KEY' },
43+
});
4044
const { data, meta } = await response.json();
4145

4246
// List markets with event counts
@@ -51,7 +55,10 @@ data.forEach(m => {
5155
```python
5256
import requests
5357
54-
response = requests.get('https://api.sharpapi.io/api/v1/markets')
58+
response = requests.get(
59+
'https://api.sharpapi.io/api/v1/markets',
60+
headers={'X-API-Key': 'YOUR_API_KEY'},
61+
)
5562
result = response.json()
5663
5764
for market in result['data']:

content/en/api-reference/sports.mdx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ GET /api/v1/sports
1515
```
1616

1717
<Callout type="info">
18-
These are **public endpoints** -- no authentication required. Unauthenticated requests are rate-limited to 10 requests/minute. Authenticated requests receive your tier's full rate limit.
18+
Requires an API key. Available on all tiers (Free included). Unauthenticated requests return `401`.
1919
</Callout>
2020

2121
## List All Sports
@@ -25,18 +25,15 @@ These are **public endpoints** -- no authentication required. Unauthenticated re
2525
<Tabs items={['cURL', 'JavaScript', 'Python']}>
2626
<Tabs.Tab>
2727
```bash
28-
# No API key required
29-
curl -X GET "https://api.sharpapi.io/api/v1/sports"
30-
31-
# With API key for higher rate limits
3228
curl -X GET "https://api.sharpapi.io/api/v1/sports" \
3329
-H "X-API-Key: YOUR_API_KEY"
3430
```
3531
</Tabs.Tab>
3632
<Tabs.Tab>
3733
```javascript
38-
// No API key required for public reference endpoints
39-
const response = await fetch('https://api.sharpapi.io/api/v1/sports');
34+
const response = await fetch('https://api.sharpapi.io/api/v1/sports', {
35+
headers: { 'X-API-Key': 'YOUR_API_KEY' },
36+
});
4037
const { data, meta } = await response.json();
4138

4239
data.forEach(sport => {
@@ -49,8 +46,10 @@ data.forEach(sport => {
4946
```python
5047
import requests
5148

52-
# No API key required
53-
response = requests.get('https://api.sharpapi.io/api/v1/sports')
49+
response = requests.get(
50+
'https://api.sharpapi.io/api/v1/sports',
51+
headers={'X-API-Key': 'YOUR_API_KEY'},
52+
)
5453
result = response.json()
5554

5655
for sport in result['data']:

content/en/api-reference/sportsbooks.mdx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ GET /api/v1/sportsbooks
1515
```
1616

1717
<Callout type="info">
18-
These are **public endpoints** -- no authentication required. Unauthenticated requests are rate-limited to 10 requests/minute. Authenticated requests receive your tier's full rate limit.
18+
Requires an API key. Available on all tiers (Free included). Unauthenticated requests return `401`.
1919
</Callout>
2020

2121
## List All Sportsbooks
@@ -25,17 +25,15 @@ These are **public endpoints** -- no authentication required. Unauthenticated re
2525
<Tabs items={['cURL', 'JavaScript', 'Python']}>
2626
<Tabs.Tab>
2727
```bash
28-
# No API key required
29-
curl -X GET "https://api.sharpapi.io/api/v1/sportsbooks"
30-
31-
# With API key for higher rate limits
3228
curl -X GET "https://api.sharpapi.io/api/v1/sportsbooks" \
3329
-H "X-API-Key: YOUR_API_KEY"
3430
```
3531
</Tabs.Tab>
3632
<Tabs.Tab>
3733
```javascript
38-
const response = await fetch('https://api.sharpapi.io/api/v1/sportsbooks');
34+
const response = await fetch('https://api.sharpapi.io/api/v1/sportsbooks', {
35+
headers: { 'X-API-Key': 'YOUR_API_KEY' },
36+
});
3937
const { data, meta } = await response.json();
4038

4139
// Filter for sharp books
@@ -51,7 +49,10 @@ console.log('Pro-tier books:', proBooks.map(b => b.display_name));
5149
```python
5250
import requests
5351

54-
response = requests.get('https://api.sharpapi.io/api/v1/sportsbooks')
52+
response = requests.get(
53+
'https://api.sharpapi.io/api/v1/sportsbooks',
54+
headers={'X-API-Key': 'YOUR_API_KEY'},
55+
)
5556
result = response.json()
5657

5758
for book in result['data']:

content/en/api-reference/teams.mdx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ GET /api/v1/teams
1414

1515
## Authentication
1616

17-
Public endpoint. No API key required.
17+
Requires an API key. Available on all tiers (Free included). Unauthenticated requests return `401`.
1818

1919
## Query Parameters
2020

@@ -34,20 +34,24 @@ The `q` parameter searches both the team `name` and `aliases` fields. For exampl
3434
<Tabs.Tab>
3535
```bash
3636
# Get all NBA teams
37-
curl "https://api.sharpapi.io/api/v1/teams?league=NBA"
37+
curl "https://api.sharpapi.io/api/v1/teams?league=NBA" \
38+
-H "X-API-Key: YOUR_API_KEY"
3839

3940
# Search for a team by name
40-
curl "https://api.sharpapi.io/api/v1/teams?q=lakers"
41+
curl "https://api.sharpapi.io/api/v1/teams?q=lakers" \
42+
-H "X-API-Key: YOUR_API_KEY"
4143

4244
# Get all basketball teams
43-
curl "https://api.sharpapi.io/api/v1/teams?sport=basketball"
45+
curl "https://api.sharpapi.io/api/v1/teams?sport=basketball" \
46+
-H "X-API-Key: YOUR_API_KEY"
4447
```
4548
</Tabs.Tab>
4649
<Tabs.Tab>
4750
```javascript
4851
// Search for a team
4952
const response = await fetch(
50-
'https://api.sharpapi.io/api/v1/teams?q=arsenal'
53+
'https://api.sharpapi.io/api/v1/teams?q=arsenal',
54+
{ headers: { 'X-API-Key': 'YOUR_API_KEY' } },
5155
);
5256
const { data, meta } = await response.json();
5357

@@ -65,7 +69,8 @@ import requests
6569

6670
response = requests.get(
6771
'https://api.sharpapi.io/api/v1/teams',
68-
params={'sport': 'basketball', 'league': 'NBA'}
72+
params={'sport': 'basketball', 'league': 'NBA'},
73+
headers={'X-API-Key': 'YOUR_API_KEY'},
6974
)
7075
result = response.json()
7176

0 commit comments

Comments
 (0)