API Documentation
Everything you need to integrate Sprime: endpoints, auth, caching, and error handling.
Everything you need to integrate Sprime: endpoints, auth, caching, and error handling.
All requests require an API key in the header:
Base URL: https://sprime.us/v1
Use GET /v1/endpoints to see which endpoints are available on your plan.
Current weather conditions by city name or coordinates.
| Parameter | Type | Required | Description |
|---|---|---|---|
location | string | required* | City name (e.g., "miami", "tokyo") |
lat | number | required* | Latitude (-90 to 90). Use with lon instead of location. |
lon | number | required* | Longitude (-180 to 180) |
format | string | optional | fahrenheit, kelvin (default: celsius) |
enriched | boolean | optional | Include sunrise, sunset, UV index, wind direction |
fields | string | optional | Comma-separated fields to return (e.g., "temp,windspeed") |
fresh | boolean | optional | Skip cache, fetch live data |
* Provide either location or both lat and lon
Auto-detect location from your IP address and return local weather.
Real-time cryptocurrency prices and market data.
| Parameter | Type | Required | Description |
|---|---|---|---|
symbol | string | required | Ticker (BTC, ETH, SOL) or CoinGecko ID |
convert | string | optional | Additional currency conversion (EUR, GBP) |
history | string | optional | Sparkline period: 7d or 30d |
fields | string | optional | Comma-separated fields to return |
Currently trending cryptocurrencies.
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | optional | Number of results (1-50, default: 10) |
Market cap rankings.
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | optional | Results per page (1-100, default: 10) |
page | integer | optional | Page number (default: 1) |
Historical price for a specific date.
| Parameter | Type | Required | Description |
|---|---|---|---|
symbol | string | required | Ticker or CoinGecko ID |
date | string | required | Date in YYYY-MM-DD format |
Aggregated news headlines from multiple sources.
| Parameter | Type | Required | Description |
|---|---|---|---|
category | string | optional | general, business, technology, sports, entertainment, health, science |
sentiment | boolean | optional | Add sentiment analysis to each article |
fields | string | optional | Comma-separated fields to return |
Current exchange rates from the European Central Bank. Updated daily.
| Parameter | Type | Required | Description |
|---|---|---|---|
base | string | optional | Base currency (default: USD) |
symbols | string | optional | Comma-separated target currencies (e.g., EUR,GBP,JPY) |
Historical exchange rate for a specific date.
| Parameter | Type | Required | Description |
|---|---|---|---|
date | string | required | Date in YYYY-MM-DD format |
base | string | optional | Base currency (default: USD) |
symbols | string | optional | Comma-separated target currencies |
Current time and date info for any timezone.
| Parameter | Type | Required | Description |
|---|---|---|---|
location | string | required | IANA timezone (e.g., America/New_York, Europe/London) |
List all available IANA timezone identifiers.
US AQI index, PM2.5, ozone, and other pollutant readings.
| Parameter | Type | Required | Description |
|---|---|---|---|
location | string | required* | City name |
lat | number | required* | Latitude. Use with lon instead of location. |
lon | number | required* | Longitude |
AQI categories: good (0-50), moderate (51-100), unhealthy_sensitive (101-150), unhealthy (151-200), very_unhealthy (201-300), hazardous (301+)
Convert city names to coordinates, country codes, population, and timezone.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | required | City or place name |
limit | integer | optional | Number of results (1-10, default: 5) |
Geolocation, ISP info, and timezone from any IP address. Omit the ip parameter to look up the requesting IP.
| Parameter | Type | Required | Description |
|---|---|---|---|
ip | string | optional | IP address to look up (default: your IP) |
Public holidays for 100+ countries.
| Parameter | Type | Required | Description |
|---|---|---|---|
country | string | optional | ISO 3166-1 country code (default: US) |
year | integer | optional | Year (default: current year) |
See all available endpoints and which ones your plan can access.
Send up to 10 requests in a single call. Each item in the array specifies an endpoint and its parameters.
Each batch item counts as one request toward your daily limit. The batch will be rejected if it would exceed your remaining quota.
Register a webhook to receive push notifications when conditions are met. Supports crypto price thresholds, weather alerts, and news keyword matching. Webhooks are checked when data is fetched (event-driven, not background polling) and capped at 1 delivery per hour per webhook.
Webhook URLs must use HTTPS and pass DNS validation. Deliveries include an HMAC-SHA256 signature for verification.
List all active webhooks for your API key.
Deactivate a webhook by its ID.
Daily request limits based on your plan:
| Plan | Requests/Day | Endpoints | Weather TTL |
|---|---|---|---|
| Free | 500 | 3 core | 10 min |
| Starter | 5,000 | 15+ | 5 min |
| Pro | 20,000 | All + Webhooks | 2 min |
The Weather TTL above is plan-specific. Other endpoints use fixed TTLs regardless of plan: crypto caches for 2 minutes, news for 15 minutes, timezone for 1 minute, air quality for 10 minutes, and static data (forex, holidays, geocoding, IP) for 24 hours. All requests count toward your daily limit.
Data endpoint responses include these headers:
| Header | Description |
|---|---|
X-Cache-Hit | true/false |
X-Cache-Age | Seconds since data was cached |
X-Cache-TTL | Cache lifetime in seconds |
X-Next-Update | ISO timestamp when fresh data will be fetched |
X-Rate-Limit-Remaining | Requests left today |
All errors return a consistent format:
| Code | Meaning |
|---|---|
| 400 | Bad request (missing or invalid parameters) |
| 401 | Unauthorized (invalid or missing API key) |
| 403 | Endpoint restricted (upgrade your plan) |
| 429 | Rate limit exceeded |
| 500 | Server error |