Python SDK
BetaUse the official Getme Python SDK for server-side integrations and automation.
Getme Python is the official Python client for Getme developer APIs.
Installation
pip install getme-python
Python 3.10 or newer is required.
Source code: github.com/getme-tech/getme-python
Quick start
from getme import GetmeClient
client = GetmeClient(api_key="gmat_test_...")
sites = client.sites.list()
products = client.products.list(limit=10)
manifest = client.sites.source.manifest("site_...")
print([site["name"] for site in sites["data"]])
print([product["name"] for product in products["data"]])
print([file["path"] for file in manifest["files"]])
Use an app-install access token such as gmat_test_... or gmat_live_....
Pagination
first_page = client.sites.list(limit=25)
if first_page["has_more"] and first_page["data"]:
next_page = client.sites.list(
limit=25,
cursor=first_page["data"][-1]["id"],
)
For full scans:
for site in client.sites.list_auto_paging(limit=100):
print(site["id"], site["name"])
for product in client.products.list_auto_paging(limit=100):
print(product["id"], product["name"])
The SDK sends cursor as starting_after.
Commerce catalog
product = client.products.create({
"name": "Coffee",
"sku": "COF-001",
"status": "draft",
})
client.products.update(product["id"], {"status": "active"})
client.products.archive(product["id"])
client.categories.create({"name": "Menu", "type": "product"})
client.brands.create({"name": "Acme"})
client.services.create({"name": "Consulting"})
Mutations generate an idempotency key automatically unless you pass one in request options.
Website source
Create a standalone site directly from a complete custom source tree when no live site or base-theme selection exists:
custom = client.sites.development.create_from_source({
"name": "Custom storefront",
"message": "Initial source",
"files": custom_theme_files,
})
print(custom["site_id"], custom["id"], custom["source_revision"])
The API validates the full archive before creating the draft. The returned site and session ids intentionally match. Subsequent source writes, previews, and publish requests use the existing development-session methods.
session = client.sites.development.create_session(
"site_...",
{"source_revision": "rev_live", "name": "Header update"},
)
client.sites.development.push_batch(
"site_...",
session["id"],
{
"source_revision": "rev_live",
"files": {"theme.json": '{"name":"Updated theme"}'},
},
)
client.sites.pages.upsert_content(
"site_...",
session["id"],
"wpag_...",
"en",
{"source_revision": "rev_live", "values": {"title": "Updated docs"}},
)
preview = client.sites.development.preview(
"site_...",
session["id"],
{"expires_days": 7},
)
print(preview["preview_url"])