Skip to content

Latest commit

 

History

History
343 lines (270 loc) · 10.2 KB

File metadata and controls

343 lines (270 loc) · 10.2 KB
title Quickstart
description Get started with the Mr. Doge API in under 5 minutes

Get Your First Odds in 5 Minutes

This guide will walk you through creating an account, getting your API key, purchasing credits, and making your first API request.

Sign up for a free account at [mrdoge.co](https://mrdoge.co)
1. Visit [mrdoge.co/register](https://mrdoge.co/register)
2. Enter your email and create a password or sign up with Google
3. You're in instantly — no email verification required. **Every new account gets 500 free credits** to start testing the API immediately.

<Check>
  **500 free credits included!** No credit card required. Start making API calls right away.
</Check>
Your 500 free credits are great for testing, but when you're ready for production, purchase more credits from your dashboard.
<Info>
  **Why Credits?** We use a pay-as-you-go model. Buy credits once, use them whenever you need. No monthly subscriptions or hidden fees.
</Info>

**Available Packages:**
- **STARTER**: 20,000 credits - $29.90
- **GROWTH**: 100,000 credits - $59.90
- **BUSINESS**: 500,000 credits - $199.90
- **ENTERPRISE**: 2,000,000 credits - $599.90

Most endpoints cost only 1 credit per request, so your free 500 credits = 500 API calls!

<Card title="View Full Pricing" icon="tag" href="/credits/pricing">
  See detailed credit costs for each endpoint
</Card>
Create your first API key in the dashboard:
1. Go to **Dashboard → API Keys**
2. Click **Create API Key**
3. Enter a name (e.g., "Production App")
4. Click **Create**

<Warning>
  Store your API key securely. It provides access to your credits and data. Never commit it to version control or share it publicly.
</Warning>
Let's fetch today's soccer matches with odds and AI recommendations!
<CodeGroup>
```bash cURL
curl -X GET "https://api.mrdoge.co/v2/matches?sport=soccer&status=upcoming&status=live&locale=en" \
  -H "Authorization: Bearer sk_live_your_api_key_here"
```

```javascript JavaScript/Node.js
const fetch = require('node-fetch');

async function getEvents() {
  const response = await fetch(
    'https://api.mrdoge.co/v2/matches?sport=soccer&status=upcoming&status=live&locale=en',
    {
      headers: {
        'Authorization': 'Bearer sk_live_your_api_key_here'
      }
    }
  );

  const data = await response.json();

  // Check credit usage
  console.log('Credits Remaining:', response.headers.get('X-Credits-Remaining'));
  console.log('Credits Consumed:', response.headers.get('X-Credits-Consumed'));

  console.log(`Found ${data.count} upcoming soccer matches`);
  return data;
}

getEvents();
```

```python Python
import requests

def get_events():
    url = 'https://api.mrdoge.co/v2/matches'
    headers = {'Authorization': 'Bearer sk_live_your_api_key_here'}
    params = {'sport': 'soccer', 'status': ['upcoming', 'live'], 'locale': 'en'}

    response = requests.get(url, headers=headers, params=params)

    # Check credit usage
    print(f"Credits Remaining: {response.headers.get('X-Credits-Remaining')}")
    print(f"Credits Consumed: {response.headers.get('X-Credits-Consumed')}")

    events = response.json()
    print(f"Found {events.get('count', len(events.get('data', [])))} upcoming soccer matches")
    return events

get_events()
```

```php PHP
<?php
$apiKey = 'sk_live_your_api_key_here';
$url = 'https://api.mrdoge.co/v2/matches?sport=soccer&status=upcoming&status=live&locale=en';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . $apiKey
]);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Get credit headers
$headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
$headers = substr($response, 0, $headerSize);

curl_close($ch);

$events = json_decode($response, true);
echo "Found " . count($events['data'] ?? []) . " upcoming soccer matches\n";
?>
```
</CodeGroup>

<Check>
  **Success!** You've made your first API request. The response includes:
  - Event details (teams, start time, competition)
  - Markets and betting odds
  - AI recommendations with edge percentage
  - Your remaining credit balance in response headers
</Check>
Track your API usage and credit consumption in real-time:
1. Go to **Dashboard → API Keys**
2. Click on your API key to view detailed analytics
3. See request volumes, credits used, and response times
4. View endpoint breakdown to optimize your usage

<Tip>
  Enable **Auto-Recharge** to automatically top up your credits when they run low. Never miss an API call!
</Tip>

Understanding the Response

Here's what you get back from the /v2/matches endpoint:

{
  "data": [
    {
      "id": "match_123456",
      "slug": "arsenal-vs-chelsea-2025-11-05",
      "homeTeam": {
        "id": "team_456",
        "name": "Arsenal",
        "logo": "https://api.mrdoge.co/images/teams/95450.png"
      },
      "awayTeam": {
        "id": "team_789",
        "name": "Chelsea",
        "logo": "https://api.mrdoge.co/images/teams/197280.png"
      },
      "startTime": "2025-11-05T20:00:00Z",
      "competition": {
        "id": "comp_123",
        "name": "Premier League",
        "logo": "https://api.mrdoge.co/images/regions/6.png"
      },
      "region": {
        "id": "region_01",
        "name": "England",
        "code": "GB"
      },
      "status": "scheduled",
      "markets": [
        {
          "id": "mkt_001",
          "name": "Match Winner",
          "type": "1X2",
          "betItems": [
            {
              "id": "bet_001",
              "outcome": "Arsenal",
              "odds": 2.1,
              "impliedProbability": 0.476
            },
            {
              "id": "bet_002",
              "outcome": "Draw",
              "odds": 3.4,
              "impliedProbability": 0.294
            },
            {
              "id": "bet_003",
              "outcome": "Chelsea",
              "odds": 3.8,
              "impliedProbability": 0.263
            }
          ]
        }
      ],
      "bettingRecommendations": [
        {
          "id": "rec_xyz",
          "market": "Match Winner",
          "outcome": "Arsenal",
          "recommendedOdds": 2.1,
          "confidence": "High",
          "edgePercentage": 7.2,
          "kellyFraction": 0.034,
          "rationale": "Strong home form with 8 wins in last 10 matches. Chelsea dealing with key injuries in defense.",
          "createdAt": "2025-11-05T10:30:00Z"
        }
      ]
    }
  ],
  "count": 1
}

What's Next?

Now that you've made your first API call, explore these powerful features:

Browse our complete API reference with 10+ endpoints for odds, live data, and AI predictions

{" "}

Learn how to fetch real-time scores and live betting markets

{" "}

Master advanced filtering by region, competition, date range, and more Learn best practices for handling errors and rate limits

Common First-Time Issues

**Problem**: You're getting a 401 error when making requests.
**Solutions**:
- Verify your API key is correct and starts with `sk_live_`
- Ensure you're using Bearer authentication: `Authorization: Bearer sk_live_...`
- Check that your API key hasn't been deactivated in the dashboard
- Make sure you have sufficient credits
**Problem**: Getting a 402 error even though you purchased credits.
**Solutions**:
- Check your credit balance in the dashboard
- Verify the payment was successful (check your email)
- Wait 1-2 minutes for credits to reflect (usually instant)
- Contact support if credits don't appear after 5 minutes
**Problem**: API returns `[]` with no events.
**Solutions**:
- Try removing the `sport` filter to see all sports
- Check if you're filtering by a future date with no scheduled events
- Add `status=completed` if you need settled events
- Some sports may not have events during off-season
**Problem**: API requests are taking too long.
**Solutions**:
- Use pagination with the `limit` parameter (default: 100)
- Filter by specific `competitionId` or `regionId` instead of fetching all
- Cache `/v2/matches` responses (or your prerender output) for static pages
- Check your internet connection

Need Help?

Get help from other developers and the Mr. Doge team

{" "}

Contact our technical support team directly

{" "}

Browse all guides and API references **Pro Tip**: Use your 500 free credits to test and prototype. When you're ready for production, the STARTER package (20,000 credits for $29.90) is perfect for small to medium apps. Credits never expire!