API Documentation

Everything you need to integrate Sprime: endpoints, auth, caching, and error handling.

Quick Start

All requests require an API key in the header:

curl -H "x-api-key: your_api_key_here" \ "https://sprime.us/v1/weather?location=miami"

Base URL: https://sprime.us/v1

Use GET /v1/endpoints to see which endpoints are available on your plan.

Weather API Free

GET/v1/weather

Current weather conditions by city name or coordinates.

ParameterTypeRequiredDescription
locationstringrequired*City name (e.g., "miami", "tokyo")
latnumberrequired*Latitude (-90 to 90). Use with lon instead of location.
lonnumberrequired*Longitude (-180 to 180)
formatstringoptionalfahrenheit, kelvin (default: celsius)
enrichedbooleanoptionalInclude sunrise, sunset, UV index, wind direction
fieldsstringoptionalComma-separated fields to return (e.g., "temp,windspeed")
freshbooleanoptionalSkip cache, fetch live data

* Provide either location or both lat and lon

{ "status": "success", "data": { "temp": 26.4, "condition": 2, "windspeed": 12.3, "location": "Miami, United States", "unit": "celsius" }, "source": "open-meteo", "timestamp": "2026-02-06T15:30:00Z" }

GET/v1/weather/auto

Auto-detect location from your IP address and return local weather.

Crypto API Free

GET/v1/crypto

Real-time cryptocurrency prices and market data.

ParameterTypeRequiredDescription
symbolstringrequiredTicker (BTC, ETH, SOL) or CoinGecko ID
convertstringoptionalAdditional currency conversion (EUR, GBP)
historystringoptionalSparkline period: 7d or 30d
fieldsstringoptionalComma-separated fields to return
{ "status": "success", "data": { "symbol": "BTC", "price": 97250.18, "change_24h": 2.31, "market_cap": 1920000000000 }, "source": "coingecko", "timestamp": "2026-02-06T15:30:00Z" }

GET/v1/crypto/trending Free

Currently trending cryptocurrencies.

ParameterTypeRequiredDescription
limitintegeroptionalNumber of results (1-50, default: 10)

GET/v1/crypto/rankings Free

Market cap rankings.

ParameterTypeRequiredDescription
limitintegeroptionalResults per page (1-100, default: 10)
pageintegeroptionalPage number (default: 1)

GET/v1/crypto/history Free

Historical price for a specific date.

ParameterTypeRequiredDescription
symbolstringrequiredTicker or CoinGecko ID
datestringrequiredDate in YYYY-MM-DD format

News API Free

GET/v1/news

Aggregated news headlines from multiple sources.

ParameterTypeRequiredDescription
categorystringoptionalgeneral, business, technology, sports, entertainment, health, science
sentimentbooleanoptionalAdd sentiment analysis to each article
fieldsstringoptionalComma-separated fields to return
{ "status": "success", "data": [ { "title": "New AI Breakthrough in Healthcare", "source": "TechCrunch", "url": "https://example.com/article", "published_at": "2026-02-06T14:22:00Z", "description": "Researchers announce...", "category": "technology" } ], "source": "newsapi", "timestamp": "2026-02-06T15:30:00Z" }

Forex API Starter

GET/v1/forex

Current exchange rates from the European Central Bank. Updated daily.

ParameterTypeRequiredDescription
basestringoptionalBase currency (default: USD)
symbolsstringoptionalComma-separated target currencies (e.g., EUR,GBP,JPY)
{ "status": "success", "data": { "base": "USD", "date": "2026-02-06", "rates": { "EUR": 0.9234, "GBP": 0.7891, "JPY": 148.52 } }, "source": "frankfurter", "timestamp": "2026-02-06T15:30:00Z" }

GET/v1/forex/history

Historical exchange rate for a specific date.

ParameterTypeRequiredDescription
datestringrequiredDate in YYYY-MM-DD format
basestringoptionalBase currency (default: USD)
symbolsstringoptionalComma-separated target currencies

Timezone API Starter

GET/v1/timezone

Current time and date info for any timezone.

ParameterTypeRequiredDescription
locationstringrequiredIANA timezone (e.g., America/New_York, Europe/London)
{ "status": "success", "data": { "timezone": "America/New_York", "datetime": "2026-02-06T10:30:00.123456-05:00", "utc_offset": "-05:00", "abbreviation": "EST", "day_of_week": 5, "week_number": 6, "dst": false }, "source": "worldtimeapi", "timestamp": "2026-02-06T15:30:00Z" }

GET/v1/timezone/list

List all available IANA timezone identifiers.

Air Quality API Starter

GET/v1/air-quality

US AQI index, PM2.5, ozone, and other pollutant readings.

ParameterTypeRequiredDescription
locationstringrequired*City name
latnumberrequired*Latitude. Use with lon instead of location.
lonnumberrequired*Longitude
{ "status": "success", "data": { "aqi": 42, "category": "good", "pm2_5": 8.3, "pm10": 15.1, "ozone": 68.2, "nitrogen_dioxide": 12.4, "carbon_monoxide": 201.5, "location": "Tokyo, Japan" }, "source": "open-meteo", "timestamp": "2026-02-06T15:30:00Z" }

AQI categories: good (0-50), moderate (51-100), unhealthy_sensitive (101-150), unhealthy (151-200), very_unhealthy (201-300), hazardous (301+)

Geocode API Starter

GET/v1/geocode

Convert city names to coordinates, country codes, population, and timezone.

ParameterTypeRequiredDescription
querystringrequiredCity or place name
limitintegeroptionalNumber of results (1-10, default: 5)
{ "status": "success", "data": [ { "name": "London", "country": "United Kingdom", "country_code": "GB", "admin1": "England", "latitude": 51.50853, "longitude": -0.12574, "elevation": 25, "population": 7556900, "timezone": "Europe/London" } ], "count": 1, "source": "open-meteo", "timestamp": "2026-02-06T15:30:00Z" }

IP Lookup API Starter

GET/v1/ip-lookup

Geolocation, ISP info, and timezone from any IP address. Omit the ip parameter to look up the requesting IP.

ParameterTypeRequiredDescription
ipstringoptionalIP address to look up (default: your IP)
{ "status": "success", "data": { "ip": "8.8.8.8", "country": "United States", "country_code": "US", "region": "Virginia", "city": "Ashburn", "zip": "20149", "latitude": 39.03, "longitude": -77.5, "timezone": "America/New_York", "isp": "Google LLC", "org": "Google Public DNS" }, "source": "ipwho", "timestamp": "2026-02-06T15:30:00Z" }

Holidays API Starter

GET/v1/holidays

Public holidays for 100+ countries.

ParameterTypeRequiredDescription
countrystringoptionalISO 3166-1 country code (default: US)
yearintegeroptionalYear (default: current year)
{ "status": "success", "data": [ { "date": "2026-01-01", "name": "New Year's Day", "name_en": "New Year's Day", "country_code": "US", "fixed": true, "global": true, "type": "public" } ], "count": 11, "source": "nager-date", "timestamp": "2026-02-06T15:30:00Z" }

Astronomy API Free

GET/v1/astronomy/iss

Real-time position of the International Space Station. Updated every 10 seconds.

ParameterTypeRequiredDescription
No parameters required
{ "status": "success", "data": { "latitude": 23.45, "longitude": -87.12, "altitude_km": 421.3, "velocity_kmh": 27580, "visibility": "daylight" }, "source": "wheretheiss", "timestamp": "2026-02-06T15:30:00Z" }

GET/v1/astronomy/sunrise

Sunrise, sunset, solar noon, and twilight times for a given location.

ParameterTypeRequiredDescription
latnumberrequiredLatitude (-90 to 90)
lonnumberrequiredLongitude (-180 to 180)
datestringoptionalYYYY-MM-DD (default: today)
{ "status": "success", "data": { "sunrise": "2026-02-06T06:47:00+00:00", "sunset": "2026-02-06T17:52:00+00:00", "solar_noon": "2026-02-06T12:19:00+00:00", "day_length_sec": 39900, "civil_twilight_begin": "2026-02-06T06:20:00+00:00", "civil_twilight_end": "2026-02-06T18:19:00+00:00", "date": "today" }, "source": "sunrise-sunset.org", "timestamp": "2026-02-06T15:30:00Z" }

GET/v1/astronomy/moon

Current moon phase, illumination, age, and distance.

ParameterTypeRequiredDescription
timestampintegeroptionalUnix timestamp in seconds (default: now)
{ "status": "success", "data": { "phase_name": "Waxing Gibbous", "illumination": 73, "age_days": 10.2, "distance_km": 384400 }, "source": "farmsense", "timestamp": "2026-02-06T15:30:00Z" }

Countries API Free

GET/v1/countries

Detailed country data including population, languages, currencies, timezones, and coordinates.

ParameterTypeRequiredDescription
qstringrequiredSearch query (country name, ISO code, currency, language, or capital)
bystringoptionalSearch type: name, alpha, currency, lang, capital (default: name)
{ "status": "success", "data": [ { "name": "Japan", "official_name": "Japan", "iso_alpha2": "JP", "iso_alpha3": "JPN", "region": "Asia", "subregion": "Eastern Asia", "capital": "Tokyo", "population": 125700000, "area_km2": 377930, "currencies": ["Japanese yen"], "languages": ["Japanese"], "timezones": ["UTC+09:00"], "flag_emoji": "\ud83c\uddef\ud83c\uddf5", "lat": 36, "lon": 138 } ], "count": 1, "source": "restcountries", "timestamp": "2026-02-06T15:30:00Z" }

Trivia API Free

GET/v1/trivia

Random trivia questions from the Open Trivia Database. Supports category and difficulty filtering.

ParameterTypeRequiredDescription
categorystringoptionalCategory ID (e.g., 9=general, 17=science, 23=history, 22=geography, 21=sports, 11=film)
difficultystringoptionaleasy, medium, hard
amountintegeroptionalNumber of questions (1-50, default: 5)
{ "status": "success", "data": [ { "question": "What is the capital of Australia?", "correct_answer": "Canberra", "incorrect_answers": ["Sydney", "Melbourne", "Perth"], "category": "Geography", "difficulty": "medium", "type": "multiple" } ], "count": 1, "source": "opentdb", "timestamp": "2026-02-06T15:30:00Z" }

Numbers API Free

GET/v1/numbers

Interesting facts about numbers. Supports trivia, math, date, and year types.

ParameterTypeRequiredDescription
numberintegerrequiredThe number to look up
typestringoptionaltrivia, math, date, year (default: trivia)
{ "status": "success", "data": { "number": 42, "type": "trivia", "fact": "42 is the answer to life, the universe, and everything." }, "source": "numbersapi", "timestamp": "2026-02-06T15:30:00Z" }

Sports API Starter

GET/v1/sports/scores

Live and recent game scores from major leagues. Failover between ESPN and TheSportsDB.

ParameterTypeRequiredDescription
leaguestringrequiredLeague code: nfl, nba, mlb, nhl, mls, epl, ucl
{ "status": "success", "data": { "league": "NBA", "games": [ { "id": "401584901", "name": "Miami Heat at Los Angeles Lakers", "status": "Final", "home_team": "Los Angeles Lakers", "home_score": "112", "away_team": "Miami Heat", "away_score": "108", "start_time": "2026-02-06T00:30Z" } ], "source": "espn" }, "source": "espn", "timestamp": "2026-02-06T15:30:00Z" }

Translation API Starter

GET/v1/translate

Translate text between languages. Failover between MyMemory and Lingva providers.

ParameterTypeRequiredDescription
textstringrequiredText to translate
tostringrequiredTarget language code (e.g., es, fr, de, ja, pt, zh)
fromstringoptionalSource language code (default: auto-detect)
{ "status": "success", "data": { "translated_text": "Hola, mundo!", "detected_language": "en", "source_lang": "auto", "target_lang": "es" }, "source": "mymemory", "timestamp": "2026-02-06T15:30:00Z" }

Domain Lookup API Pro

GET/v1/domain/lookup

RDAP-based domain registration data including registrar, nameservers, and expiration dates.

ParameterTypeRequiredDescription
domainstringrequiredDomain name (e.g., example.com). Protocol and path are stripped automatically.
{ "status": "success", "data": { "domain": "example.com", "status": ["client delete prohibited"], "nameservers": ["a.iana-servers.net", "b.iana-servers.net"], "registrar": "RESERVED-Internet Assigned Numbers Authority", "registered": "1995-08-14T04:00:00Z", "expires": "2026-08-13T04:00:00Z", "last_changed": "2025-07-31T07:00:00Z" }, "source": "rdap", "timestamp": "2026-02-06T15:30:00Z" }

Context API Free

GET/v1/context

Composite endpoint that returns weather, crypto, and news in a single call. Useful for building dashboards or providing ambient context to apps. Each underlying data source uses its own failover chain.

ParameterTypeRequiredDescription
locationstringoptionalCity name for weather (geocoded automatically)
latnumberoptionalLatitude for weather (use with lon)
lonnumberoptionalLongitude for weather
coinstringoptionalCoinGecko ID (default: bitcoin)
symbolstringoptionalCrypto ticker symbol (default: btc)
categorystringoptionalNews category: general, business, technology, etc. (default: general)

If no location parameters are provided, defaults to Orlando, FL. Weather, crypto, and news are fetched in parallel; if any source fails, its field contains an error object instead of data.

{ "status": "success", "version": "2.2.0", "timestamp": "2026-02-06T15:30:00Z", "location": { "lat": 25.76, "lon": -80.19, "name": "Miami, United States" }, "weather": { "temp": 26.4, "condition": 2, "windspeed": 12.3, "location": "Miami, United States", "unit": "celsius" }, "crypto": { "symbol": "BTC", "price": 97250.18, "change_24h": 2.31, "market_cap": 1920000000000 }, "news": [ { "title": "New AI Breakthrough in Healthcare", "source": "TechCrunch", "url": "https://example.com/article" } ] }

Endpoint Discovery Free

GET/v1/endpoints

See all available endpoints and which ones your plan can access.

{ "status": "success", "plan": "free", "total_endpoints": 18, "accessible": 5, "endpoints": { "weather": { "path": "/v1/weather", "tier": "free", "accessible": true }, "forex": { "path": "/v1/forex", "tier": "starter", "accessible": false }, ... } }

Batch Requests Free

POST/v1/batch

Send multiple requests in a single call. Each item in the array specifies an endpoint and its parameters. The batch limit and concurrency depend on your plan:

PlanMax items/batchConcurrency
Free104
Starter258
Pro7516
curl -X POST -H "x-api-key: your_key" \ -H "Content-Type: application/json" \ -d '{ "requests": [ { "endpoint": "weather", "params": { "location": "miami" } }, { "endpoint": "crypto", "params": { "symbol": "BTC" } }, { "endpoint": "news", "params": { "category": "technology" } } ] }' \ "https://sprime.us/v1/batch"

Each item in the batch counts as one request toward your daily quota. A 10-item batch uses 10 of your daily requests. The quota is reserved atomically when the request is authenticated; the batch will be rejected upfront if it would exceed your remaining quota.

Webhooks Pro

POST/v1/webhooks/register

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.

GET/v1/webhooks/list

List all active webhooks for your API key.

DELETE/v1/webhooks/:id

Deactivate a webhook by its ID.

Rate Limits & Caching

Daily request limits and burst rate limits based on your plan:

PlanRequests/DayBurst (req/min)EndpointsWeather TTL
Free500303 core10 min
Starter5,00012015+5 min
Pro20,000600All + Webhooks2 min

The burst limit (req/min) applies per API key within a 60-second window. Exceeding it returns HTTP 429 with a Retry-After header. Daily quotas reset at midnight UTC.

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 (including each item in a batch) count toward your daily limit.

Data endpoint responses include these headers:

HeaderDescription
X-Cache-Hittrue/false
X-Cache-AgeSeconds since data was cached
X-Cache-TTLCache lifetime in seconds
X-Next-UpdateISO timestamp when fresh data will be fetched
X-Rate-Limit-RemainingRequests left today

Error Handling

All errors return a consistent format:

{ "error": "Invalid API key" }
CodeMeaning
400Bad request (missing or invalid parameters)
401Unauthorized (invalid or missing API key)
403Endpoint restricted (upgrade your plan)
429Rate limit exceeded
500Server error