Authentication
How to authenticate with the BlueGamma API using your API key.
Last updated
Was this helpful?
Was this helpful?
import requests
headers = {
"x-api-key": "your_api_key_here"
}
response = requests.get(
"https://api.bluegamma.io/v1/swap_rate",
params={"index": "SOFR", "start_date": "0D", "maturity_date": "5Y", "fixed_leg_frequency": "6M"},
headers=headers
)
print(response.json())const response = await fetch(
"https://api.bluegamma.io/v1/swap_rate?index=SOFR&start_date=0D&maturity_date=5Y&fixed_leg_frequency=6M",
{
headers: {
"x-api-key": "your_api_key_here"
}
}
);
const data = await response.json();
console.log(data);# Store in environment variable
export BLUEGAMMA_API_KEY="your_api_key_here"import os
api_key = os.environ.get("BLUEGAMMA_API_KEY")