🌟🌟 Welcome to the Juju Public API Service! 🌟🌟

API Endpoints


1. Email Validation

Validates email address format.

Endpoint: POST /email

Request:

curl -X POST https://services.gctl.io/email \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com"}'

Response:

{
  "valid": true,
  "error": null
}

Invalid Example:

curl -X POST https://services.gctl.io/email \
  -H "Content-Type: application/json" \
  -d '{"email": "invalid-email"}'

Response:

{
  "valid": false,
  "error": "InvalidFormat"
}

2. Domain Validation

Validates domain format and optionally performs DNS lookups.

Endpoint: POST /domain

Basic Validation:

curl -X POST https://services.gctl.io/domain \
  -H "Content-Type: application/json" \
  -d '{"domain": "example.com"}'

With DNS Lookups:

curl -X POST https://services.gctl.io/domain \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "google.com",
    "check_a": true,
    "check_mx": true,
    "check_ns": true,
    "check_soa": false,
    "check_cname": false
  }'

Response:

{
  "valid": true,
  "error": null,
  "a_records": ["142.250.185.46"],
  "mx_records": ["smtp.google.com (priority: 10)"],
  "ns_records": ["ns1.google.com.", "ns2.google.com."]
}

3. IP Address Validation

Validates IP addresses (IPv4 and IPv6) and provides address information.

Endpoint: POST /ip

IPv4 Example:

curl -X POST https://services.gctl.io/ip \
  -H "Content-Type: application/json" \
  -d '{"ip": "192.168.1.1"}'

Response:

{
  "valid": true,
  "error": null,
  "ip_type": "IPv4",
  "is_loopback": false,
  "is_private": true,
  "is_multicast": false,
  "is_cgnat": false,
  "is_linklocal": false
}

IPv6 Example:

curl -X POST https://services.gctl.io/ip \
  -H "Content-Type: application/json" \
  -d '{"ip": "2001:4860:4860::8888"}'

With Reverse DNS:

curl -X POST https://services.gctl.io/ip \
  -H "Content-Type: application/json" \
  -d '{"ip": "8.8.8.8", "check_ptr": true}'

4. ID Generation

Generates unique identifiers in various formats.

Endpoint: POST /idgen

Supported ID Types:

Default (UUID v4):

curl -X POST https://services.gctl.io/idgen \
  -H "Content-Type: application/json" \
  -d '{}'

Generate 5 UUIDs v7:

curl -X POST https://services.gctl.io/idgen \
  -H "Content-Type: application/json" \
  -d '{"id_type": "uuid_v7", "count": 5}'

Response:

{
  "ids": [
    "01943c8e-7b2a-7890-a1b2-c3d4e5f6g7h8",
    "01943c8e-7b2a-7891-a1b2-c3d4e5f6g7h9",
    "01943c8e-7b2a-7892-a1b2-c3d4e5f6g7ha",
    "01943c8e-7b2a-7893-a1b2-c3d4e5f6g7hb",
    "01943c8e-7b2a-7894-a1b2-c3d4e5f6g7hc"
  ],
  "id_type": "uuid_v7",
  "count": 5,
  "description": "Time-ordered UUID, sortable by creation time"
}

Generate NanoID:

curl -X POST https://services.gctl.io/idgen \
  -H "Content-Type: application/json" \
  -d '{"id_type": "nanoid", "count": 3}'

5. Bitcoin Price

Get current Bitcoin price from Pyth Network.

Endpoint: GET /bitcoin/price

Request:

curl https://services.gctl.io/bitcoin/price

Response:

{
  "price_usd": "94250.50",
  "confidence": "45.23",
  "expo": -8,
  "timestamp": 1737849600,
  "source": "Pyth Network"
}

6. BTC ↔ Satoshi Conversion

Convert between Bitcoin and Satoshis (1 BTC = 100,000,000 SATs).

Endpoint: POST /bitcoin/convert

BTC to Satoshis:

curl -X POST https://services.gctl.io/bitcoin/convert \
  -H "Content-Type: application/json" \
  -d '{"amount": "1", "from": "btc"}'

Response:

{
  "from_amount": "1.00000000",
  "from_unit": "BTC",
  "to_amount": "100000000",
  "to_unit": "SATs",
  "error": null
}

Satoshis to BTC:

curl -X POST https://services.gctl.io/bitcoin/convert \
  -H "Content-Type: application/json" \
  -d '{"amount": "50000000", "from": "sats"}'

Response:

{
  "from_amount": "50000000",
  "from_unit": "SATs",
  "to_amount": "0.50000000",
  "to_unit": "BTC",
  "error": null
}

7. Bitcoin ↔ Fiat Conversion

Convert between Bitcoin and fiat currencies (or between fiat currencies).

Endpoint: POST /bitcoin/fiat

Supported Currencies:

BTC to USD:

curl -X POST https://services.gctl.io/bitcoin/fiat \
  -H "Content-Type: application/json" \
  -d '{"amount": "1", "from": "btc", "to": "usd"}'

Response:

{
  "from_amount": "1",
  "from_currency": "BTC",
  "to_amount": "94250.50",
  "to_currency": "USD",
  "rate": "94250.50",
  "btc_price_usd": "94250.50",
  "error": null
}

BTC to Euro:

curl -X POST https://services.gctl.io/bitcoin/fiat \
  -H "Content-Type: application/json" \
  -d '{"amount": "0.5", "from": "btc", "to": "eur"}'

BTC to Japanese Yen:

curl -X POST https://services.gctl.io/bitcoin/fiat \
  -H "Content-Type: application/json" \
  -d '{"amount": "1", "from": "btc", "to": "jpy"}'

BTC to Chinese Yuan:

curl -X POST https://services.gctl.io/bitcoin/fiat \
  -H "Content-Type: application/json" \
  -d '{"amount": "1", "from": "btc", "to": "cny"}'

BTC to Australian Dollar:

curl -X POST https://services.gctl.io/bitcoin/fiat \
  -H "Content-Type: application/json" \
  -d '{"amount": "1", "from": "btc", "to": "aud"}'

USD to BTC:

curl -X POST https://services.gctl.io/bitcoin/fiat \
  -H "Content-Type: application/json" \
  -d '{"amount": "100000", "from": "usd", "to": "btc"}'

Response:

{
  "from_amount": "100000",
  "from_currency": "USD",
  "to_amount": "1.06085193",
  "to_currency": "BTC",
  "rate": "0.00001061",
  "btc_price_usd": "94250.50",
  "error": null
}

Fiat to Fiat (GBP to USD):

curl -X POST https://services.gctl.io/bitcoin/fiat \
  -H "Content-Type: application/json" \
  -d '{"amount": "1000", "from": "gbp", "to": "usd"}'

8. Bitcoin Address Validation

Validates Bitcoin address format and identifies address type.

Endpoint: POST /bitcoin/validate

Supported Address Types:

Legacy Address (P2PKH):

curl -X POST https://services.gctl.io/bitcoin/validate \
  -H "Content-Type: application/json" \
  -d '{"address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"}'

Response:

{
  "valid": true,
  "address_type": "P2PKH (Legacy)",
  "error": null
}

SegWit Address:

curl -X POST https://services.gctl.io/bitcoin/validate \
  -H "Content-Type: application/json" \
  -d '{"address": "bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4"}'

Response:

{
  "valid": true,
  "address_type": "P2WPKH (SegWit)",
  "error": null
}

Taproot Address:

curl -X POST https://services.gctl.io/bitcoin/validate \
  -H "Content-Type: application/json" \
  -d '{"address": "bc1pxwww0ct9ue7e8tdnlmug5m2tamfn7q06sahstg39ys4c9f3340qqxrdu9k"}'

Invalid Address:

curl -X POST https://services.gctl.io/bitcoin/validate \
  -H "Content-Type: application/json" \
  -d '{"address": "not-a-bitcoin-address"}'

Response:

{
  "valid": false,
  "address_type": null,
  "error": "Invalid Bitcoin address format"
}

9. URL Shortening

Shorten long URLs and resolve them via redirect.

Shorten Endpoint: POST /shorten

Request:

curl -X POST https://services.gctl.io/shorten \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/very/long/path?query=string&foo=bar"}'

Response:

{
  "short_url": "https://s.gctl.io/gXLjObo",
  "code": "gXLjObo",
  "ttl_seconds": 86400
}

Resolve Endpoint: GET https://s.gctl.io/{code}

Redirects (HTTP 302) to the original URL.

curl -v https://s.gctl.io/gXLjObo
# < HTTP/2 302
# < location: https://example.com/very/long/path?query=string&foo=bar

Expired/Invalid Code:

curl https://s.gctl.io/ZZZZZZZ

Response (404):

{
  "error": "Short URL not found or expired"
}

Invalid URL:

curl -X POST https://services.gctl.io/shorten \
  -H "Content-Type: application/json" \
  -d '{"url": "not-a-url"}'

Response (400):

{
  "error": "Invalid URL: must start with http:// or https://"
}