Documentation

Everything you need to authenticate, call endpoints and handle responses. Every example is copy-paste ready.

Introduction

The Cobra Systems API is built around live provider-backed data endpoints, with a few local utility helpers for string and format tasks. All responses are JSON. The base URL for every request is:

base url
/v1

The Cobra Systems API endpoints are public and do not require API keys. Call any endpoint directly — all responses are JSON.

Authentication

No authentication is required to call the endpoints documented here.

Request URL
/v1/weather?city=Tokyo

Quickstart

Make your first request in any language. Examples below show how to call the endpoints.

$ curl "/v1/weather?city=Tokyo"
const res = await fetch("/v1/weather?city=Tokyo")
const data = await res.json()
import requests
r = requests.get("/v1/weather",
  params={"city": "Tokyo"})

Rate limits

The free tier includes an unlimited monthly request quota with a fair-use burst limit to protect the platform. Every response includes headers so you always know where you stand.

HeaderExampleDescription
X-RateLimit-Limit120Requests allowed per rolling minute.
X-RateLimit-Remaining118Requests left in the current window.
X-RateLimit-Reset1723190400Unix timestamp when the window resets.

Exceeding the burst limit returns a 429 Too Many Requests response. Paid plans raise the burst ceiling — see pricing.

Errors

Cobra uses conventional HTTP status codes. Errors return a JSON body with a machine-readable code and a human-readable message.

error response
{
  "error": {
    "code": "server_error",
    "message": "An error occurred."
  }
}
StatusCodeMeaning
400bad_requestA required parameter is missing or malformed.
401unauthorizedUnauthorized request.
404not_foundThe requested resource does not exist.
429rate_limitedBurst limit exceeded — slow down and retry.
500server_errorSomething went wrong on our end.

Weather

GET/v1/weather

Returns current conditions and a short forecast for a city name or coordinate pair.

ParameterTypeDescription
citystringCity name, e.g. Tokyo. Required if lat/lon omitted.
latnumberLatitude. Use with lon.
lonnumberLongitude. Use with lat.
unitsstringmetric (default) or imperial.
200 OK
{ "city": "Tokyo", "temp_c": 21.4, "condition": "Partly cloudy" }

GeoIP

GET/v1/geoip

Resolves an IP address to country, city, timezone and network information.

ParameterTypeDescription
ipstringIPv4 or IPv6 address. Defaults to the caller's IP.
200 OK
{ "ip": "8.8.8.8", "country": "United States", "city": "Mountain View" }

Currency

GET/v1/currency

Live and historical exchange rates across common currencies.

ParameterTypeDescription
fromstringSource ISO 4217 code, e.g. USD.
tostringTarget ISO 4217 code, e.g. EUR.
datestringOptional YYYY-MM-DD for a historical rate.
200 OK
{ "from": "USD", "to": "EUR", "rate": 0.9213 }

QR codes

POST/v1/qrcode

Generates a QR code image and returns the SVG or PNG payload inline. Send a JSON body.

FieldTypeDescription
datastringThe text or URL to encode. Required.
sizenumberPixel size, 128–1024. Defaults to 512.
formatstringpng (default) or svg.
200 OK
{ "format": "png", "url": "https://cdn.cobrasystems.tech/qr/9f2a1c.png" }

Jokes

GET/v1/jokes

Random jokes by category — perfect for demos and side projects.

ParameterTypeDescription
categorystringOptional. dev, general or pun.
200 OK
{ "id": 42, "category": "dev", "text": "There are 10 kinds of people..." }

Time

GET/v1/time

Returns the current server time in multiple formats (unix, ISO) and the server timezone.

200 OK
{
  "unix": 1723190400,
  "iso": "2026-08-10T12:00:00.000Z",
  "timezone": "UTC"
}

Echo

GET/v1/echo

Echoes back query parameters or JSON body you send — useful for testing clients and webhooks.

ParameterTypeDescription
Anystring|number|objectAll provided query params or POST JSON are returned under the data key.
200 OK
{
  "data": { "foo": "bar", "num": "42" }
}

Status

GET/v1/status

Lightweight service status: uptime, memory usage and basic host info.

200 OK
{
  "uptime": 12345,
  "memory": { "rss": 12345678 },
  "platform": "linux"
}

Quote

GET/v1/quote

Returns a short inspirational or fun quote. No parameters required.

200 OK
{
  "id": 7,
  "text": "Do or do not. There is no try.",
  "author": "Yoda"
}

Lorem

GET/v1/lorem

Generates placeholder lorem text. Optionally set paras (number of paragraphs) and words per paragraph.

ParameterTypeDescription
parasnumberParagraph count (default 1)
wordsnumberWords per paragraph (default 50)
200 OK
{
  "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit..."
}

IP

GET/v1/ip

Returns the caller IP and any forwarded headers (X-Forwarded-For / X-Real-IP).

200 OK
{
  "ip": "203.0.113.5",
  "xff": "203.0.113.5, 198.51.100.1"
}

Math

GET/v1/math

Simple math operations. Use op (add, sub, mul, div) and numeric params a and b.

ParameterTypeDescription
opstringOperation: add, sub, mul, div
anumberLeft operand
bnumberRight operand
200 OK
{
  "op": "mul",
  "a": 6,
  "b": 7,
  "result": 42
}

UUID

GET/v1/uuid

Generate one or more UUIDs without any external dependency.

200 OK
{
  "version": "4",
  "uuid": "550e8400-e29b-41d4-a716-446655440000"
}

Hash

GET/v1/hash

Hash text with common algorithms like sha256, sha512 and md5.

200 OK
{
  "algorithm": "sha256",
  "digest": "2cf24dba5fb0a30e..."
}

Base64

GET/v1/base64

Encode or decode Base64 text locally.

200 OK
{
  "mode": "encode",
  "result": "aGVsbG8="
}

Slug

GET/v1/slug

Turn titles or phrases into URL-friendly slugs.

200 OK
{
  "slug": "hello-world"
}

Fortune

GET/v1/fortune

Returns a short random fortune for dashboards, demos and tiny dopamine hits.

200 OK
{
  "category": "work",
  "text": "A clean endpoint today saves a debugging session tomorrow."
}

Validate

GET/v1/validate

Validate emails, URLs, IP addresses, hex strings, slugs and JSON payload text.

200 OK
{
  "type": "email",
  "valid": true
}

OpenAPI

GET/v1/openapi.json

Machine-readable OpenAPI 3.0 specification for the v1 API. Use this URL to import the API into tools like Swagger, Postman or Redoc.

GET
/v1/openapi.json

Ready to build?

All endpoints are public and require no API key. If you need help or have questions, get support on Discord.