API Documentation
Welcome to the Fetcha Weather API documentation. This guide will help you get started with accessing Australian weather data from the Bureau of Meteorology.
Getting Started
1. Create Your Account
Sign up for a free account to get started. No credit card required.
Sign Up Free2. Get Your API Key
Once logged in, navigate to your dashboard to generate an API key. Keep this key secure - it's like a password for your account.
3. Make Your First Request
Here's a simple example to get weather data for Melbourne:
curl -H "X-API-Key: your_api_key_here" \
"https://api.fetchaweather.com/api/weather/location?location=Melbourne&state=Victoria"
Authentication
All API requests require authentication using an API key. Include your key in the request header:
X-API-Key: your_api_key_here
Security Best Practices
- Never commit API keys to version control
- Use environment variables to store keys
- Rotate keys if they're compromised
- Use different keys for development and production
- Monitor your usage regularly
Rate Limits & Quotas
Rate limits are based on your subscription tier:
| Tier | Monthly Quota | Rate Limit |
|---|---|---|
| Free | 100 requests/month | 10 requests/minute |
| Pro | 5,000 requests/month | 100 requests/minute |
| Enterprise | Unlimited | Custom |
API Reference
Base URL
https://api.fetchaweather.com
GET /api/weather/location
Retrieve weather data for a specific location.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| location | string | Yes | City or town name |
| state | string | Yes | State name or abbreviation (NSW, VIC, QLD, etc.) |
| date_from | string | No | Start date (YYYY-MM-DD) |
| date_to | string | No | End date (YYYY-MM-DD) |
Example Request
GET /api/weather/location?location=Sydney&state=NSW&date_from=2024-01-01&date_to=2024-01-31
Example Response
{
"success": true,
"data": {
"location": "Sydney",
"state": "New South Wales",
"station": "Sydney Observatory Hill",
"station_number": "066062",
"weather_data": [
{
"date": "2024-01-01",
"temperature_max": 28.5,
"temperature_min": 19.2,
"rainfall": 0.0,
"humidity_9am": 65,
"humidity_3pm": 52,
"wind_speed_9am": 15,
"wind_speed_3pm": 22
}
]
},
"metadata": {
"total_records": 31,
"cached": true,
"timestamp": "2025-10-31T16:00:00+10:00"
}
}
GET /api/weather/states
List all available Australian states and territories.
Example Response
{
"success": true,
"states": [
{"name": "New South Wales", "abbreviation": "NSW"},
{"name": "Victoria", "abbreviation": "VIC"},
{"name": "Queensland", "abbreviation": "QLD"},
{"name": "South Australia", "abbreviation": "SA"},
{"name": "Western Australia", "abbreviation": "WA"},
{"name": "Tasmania", "abbreviation": "TAS"},
{"name": "Northern Territory", "abbreviation": "NT"},
{"name": "Australian Capital Territory", "abbreviation": "ACT"}
]
}
Code Examples
JavaScript / Node.js
const axios = require('axios');
async function getWeather() {
try {
const response = await axios.get(
'https://api.fetchaweather.com/api/weather/location',
{
params: {
location: 'Brisbane',
state: 'Queensland',
date_from: '2024-01-01',
date_to: '2024-01-31'
},
headers: {
'X-API-Key': process.env.FETCHA_API_KEY
}
}
);
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
}
getWeather();
Python
import requests
import os
def get_weather():
url = 'https://api.fetchaweather.com/api/weather/location'
params = {
'location': 'Brisbane',
'state': 'Queensland',
'date_from': '2024-01-01',
'date_to': '2024-01-31'
}
headers = {
'X-API-Key': os.getenv('FETCHA_API_KEY')
}
try:
response = requests.get(url, params=params, headers=headers)
response.raise_for_status()
data = response.json()
print(data)
except requests.exceptions.RequestException as e:
print(f'Error: {e}')
if __name__ == '__main__':
get_weather()
PHP
<?php
$apiKey = getenv('FETCHA_API_KEY');
$url = 'https://api.fetchaweather.com/api/weather/location';
$params = [
'location' => 'Perth',
'state' => 'Western Australia',
'date_from' => '2024-01-01',
'date_to' => '2024-01-31'
];
$ch = curl_init($url . '?' . http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-Key: ' . $apiKey
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
print_r($data);
curl_close($ch);
?>
Error Codes
| Code | Error | Description |
|---|---|---|
| 400 | Bad Request | Invalid parameters or missing required fields |
| 401 | Unauthorized | Invalid or missing API key |
| 403 | Forbidden | API key doesn't have permission for this resource |
| 404 | Not Found | Location or resource not found |
| 429 | Too Many Requests | Rate limit or quota exceeded |
| 500 | Internal Server Error | Something went wrong on our end |
Error Response Format
{
"success": false,
"error": "Rate Limit Exceeded",
"message": "You have exceeded your monthly quota of 100 requests. Upgrade to Pro for 5,000 requests/month.",
"quota_remaining": 0,
"quota_reset": "2025-11-01T00:00:00+10:00"
}
Frequently Asked Questions
What data do you provide?
We provide official Bureau of Meteorology (BOM) weather data including temperature, rainfall, humidity, wind speed, and other meteorological observations from weather stations across Australia.
How far back does historical data go?
Historical data availability varies by location, with some stations having data from 1946 onwards. Most major cities have comprehensive historical records.
How accurate is the data?
All data comes directly from the Bureau of Meteorology and is as accurate as the official BOM records. We don't modify or predict data - we provide exactly what BOM publishes.
Can I use this data commercially?
Yes! All subscription tiers (including Free) allow commercial use. See our Terms of Service for details.
How do I upgrade my plan?
Upgrade functionality is coming soon with Phase 2 (Stripe integration). For now, all users are on the Free tier.
Do you offer bulk data exports?
Yes, bulk exports are available for Enterprise customers. Contact us for custom solutions.
What's your uptime guarantee?
Free tier: Best effort. Pro tier: 99.9% SLA. Enterprise: Custom SLA available.
How do I report an issue?
Email us at hello@fetchaweather.com with details about the issue.