Installation
Get started with Oddlyx in your project. Choose your preferred language and follow the setup instructions.
Prerequisites
Before you begin, make sure you have:
- An active API key from your dashboard
- Node.js 18+ (for JavaScript/TypeScript) or Python 3.8+ (for Python)
- A package manager (npm, yarn, or pip)
JavaScript / TypeScript
For Node.js projects, you can use the native fetch API (Node 18+) or install a HTTP client library.
Using Native Fetch
Node.js 18+ includes native fetch support. No installation required:
// No installation needed - fetch is built-in
const response = await fetch(
"https://odds-marketplace.onrender.com/api/v1/nba/odds/games",
{
headers: {
"Authorization": "Bearer sk_your_api_key_here"
}
}
);
const data = await response.json();Using Axios
Install axios for a more feature-rich HTTP client:
npm install axiosimport axios from 'axios';
const response = await axios.get(
'https://odds-marketplace.onrender.com/api/v1/nba/odds/games',
{
headers: {
'Authorization': 'Bearer sk_your_api_key_here'
}
}
);
console.log(response.data);Python
Install the requests library for making HTTP requests:
pip install requestsimport requests
response = requests.get(
'https://odds-marketplace.onrender.com/api/v1/nba/odds/games',
headers={'Authorization': 'Bearer sk_your_api_key_here'}
)
data = response.json()
print(data)Environment Variables
Store your API key securely using environment variables:
Create .env file
.env
ODDS_API_KEY=sk_your_api_key_here
ODDS_API_URL=https://odds-marketplace.onrender.comLoad in JavaScript
// Install dotenv
npm install dotenv
// Load in your code
import dotenv from 'dotenv';
dotenv.config();
const apiKey = process.env.ODDS_API_KEY;Load in Python
# Install python-dotenv
pip install python-dotenv
# Load in your code
from dotenv import load_dotenv
import os
load_dotenv()
api_key = os.getenv('ODDS_API_KEY')Never Commit API Keys
Always add
.env to your .gitignore file. Never commit API keys to version control.Verify Installation
Test your setup with a simple request:
const response = await fetch(
'https://odds-marketplace.onrender.com/api/v1/nba/odds/sportsbooks',
{
headers: {
'Authorization': `Bearer ${process.env.ODDS_API_KEY}`
}
}
);
if (response.ok) {
console.log('✅ API connection successful!');
const data = await response.json();
console.log(data);
} else {
console.error('❌ API connection failed:', response.status);
}