GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Explore
  • Repositories
  • Docs
  • API Center
  • interweb.co.mz
  • PT
  • Help
  • Sign in

This view

  • Original page
  • New address

GeezerVison is showing git.interweb.co.mz — api-python-sdk

interweb-mz/api-python-sdk
Watch
1
0
Fork 0
Code Issues Pull requests Projects Releases 1 Wiki Activity
Official Interweb Mozambique Python SDK: API client for domains, DNS, VPS, hosting, SMS, email and AI https://docs.interweb.co.mz
api domains email interweb interweb-mz mozambique pypi python sdk sms vps
5 commits 1 branch 1 tag 106 KiB
  • Python 100%
Find a file
Exact
Repository files (latest commit first)
Filename Latest commit message Latest commit date
RLX Holdings c4301f02dd Show the English README by default
2026-11-28 11:06:05 +02:00
.github Add CI workflow and Dependabot 2026-11-28 09:16:02 +02:00
examples Show the English README by default 2026-11-28 11:06:05 +02:00
src/interweb_mz Show the English README by default 2026-11-28 11:06:05 +02:00
CHANGELOG.md Initial release (1.0.0) 2026-11-27 22:29:25 +02:00
LICENSE Initial release (1.0.0) 2026-11-27 22:29:25 +02:00
OPERATIONS.md Initial release (1.0.0) 2026-11-27 22:29:25 +02:00
pyproject.toml Initial release (1.0.0) 2026-11-27 22:29:25 +02:00
README-pt.md Show the English README by default 2026-11-28 11:06:05 +02:00
README.md Show the English README by default 2026-11-28 11:06:05 +02:00
repo.json Use badges from the brand git 2026-11-28 10:59:51 +02:00

README.md

Interweb Mozambique API SDK for Python

Release License: MIT

A Python library for the Interweb Mozambique API: domains, DNS, SMS, E-mail Center, AI, billing, support, servers and the rest. It covers all 256 operations of the API, one method per operation, and it is generated from the OpenAPI specification, so it keeps up with the API.

Português · All operations

Install

pip install interweb-mz-sdk

Needs Python 3.8 or newer. No dependencies: only the standard library.

Get started

Create a key in the API Center of Meu Interweb (docs: https://docs.interweb.co.mz). Start with a sandbox_ key: it reads your real data, but writes are simulated and never charge. Pass the key in the code or in an environment variable: INTERWEB_API_KEY.

from interweb_mz import Client

client = Client()  # or Client(api_key="sandbox_...")
print(client.status.ping_get()["data"]["status"])

The SDK already points to the Interweb Mozambique API: https://api.interweb.co.mz.

Options: Client(api_key=..., brand=..., base_url=..., language="pt", mode="sandbox", timeout=60, max_retries=2).

The areas are status, token, actions, specification, sms, email_center, account, catalog, domains, whois, services, billing, support, dns, servers, hosting, email, extras, reseller, ai. For example, GET /v1/domains/{domain} is domains.get. The full list is in OPERATIONS.md.

Examples

Register a domain:

check = client.domains.availability(domain="example.co.mz")
if check["data"]["available"]:
    client.domains.register({"domain": "example.co.mz", "years": 1})

Send an SMS:

client.sms.messages_create({"number": "+258841234567", "text": "Your order is ready."})

Send an e-mail with the E-mail Center:

client.email_center.messages_create({
    "from": "Example <[email protected]>",
    "to": ["[email protected]"],
    "subject": "Your order is ready",
    "text": "Hello Ana, your order is ready to collect.",
})

Chat with the AI:

answer = client.ai.chat_create({
    "model": "deepseek-ai/deepseek-v4-flash",
    "messages": [{"role": "user", "content": "Write a welcome message for our website."}],
})
print(answer["choices"][0]["message"]["content"])

# With "stream": True you get an iterator of events
for event in client.ai.chat_create({"model": "deepseek-ai/deepseek-v4-flash",
                                    "messages": [{"role": "user", "content": "Hello"}], "stream": True}):
    print(event)

Complete examples are in the examples/ folder.

Errors, retries and Idempotency-Key

When the API answers with an error, the SDK throws an exception with the HTTP status, the code (it never changes), the message and the correlation_id to give to support. The most common codes: 401 unauthorized (wrong or expired key), 402 insufficient_credit (not enough balance), 403 insufficient_scope (the key lacks the permission) and 429 rate_limited.

from interweb_mz import ApiError

try:
    client.sms.messages_create({"number": "+258841234567", "text": "Hello"})
except ApiError as e:
    print(e.status, e.code, e.message, e.correlation_id)  # e.g. 402 insufficient_credit

On 429 and 5xx the SDK waits and tries again, up to 2 times by default (it follows Retry-After). On operations that accept an Idempotency-Key, the SDK creates one on its own and repeats it on every retry, so a request is never done twice. You can pass your own: idempotency_key="...".

The status and headers of the last answer are in client.last_response, for example to know whether a write was simulated (X-API-Simulated).

Webhooks

Account events arrive signed in the X-Webhook-Signature header. To check the signature:

from interweb_mz import verify_webhook

ok = verify_webhook(raw_body, request.headers["X-Webhook-Signature"], secret)

Version

Version 1.0.0, generated from version 1.0.0 of the API specification.


Maintained by RLX Holdings.

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.