Skip to main content

ada-diamonds

Official Python client for the Ada Diamonds API: live lab grown diamond inventory, engagement ring settings, fine jewelry, and diamond buying guides.

Pure Python, no dependencies beyond the standard library. Python 3.9 or newer.

Install

pip install ada-diamonds

Package page: https://pypi.org/project/ada-diamonds/. Reading the catalog needs no account and no API key.

Examples

Search live diamond inventory

from ada_diamonds import Client

client = Client()  # anonymous, 120 requests per minute
page = client.diamonds(shape="Oval", min_carat=1, max_price=4000, sort="price_asc")
for stone in page["data"]:
    print(stone["carat"], stone["shape"], stone["color"], stone["clarity"], stone["price"])
print(page["pagination"])      # {'total': ..., 'limit': 25, 'offset': 0, 'has_more': ...}
print(client.last_rate_limit)  # RateLimit({'limit': 120, 'remaining': 119, 'reset': 58, ...})

Quote a complete engagement ring

An engagement ring is a setting plus a loose diamond, priced separately. price_from on a setting excludes the center stone. All prices are US dollars.

setting = client.engagement_rings(shape="Oval", type="Solitaire", limit=1)["data"][0]
stone = client.diamonds(shape="Oval", min_carat=1.5, max_carat=1.6, sort="price_asc", limit=1)["data"][0]
print(setting["name"], "+", stone["carat"], "ct =", setting["price_from"] + stone["price"])

Get a key, then write

from ada_diamonds import AdaApiError, Client

issued = Client().create_key("my-agent", env="sandbox")   # no account needed
client = Client(api_key=issued["api_key"])                  # 600 requests per minute

try:
    result = client.request_consultation(
        {"email": "test@example.com", "topic": "engagement_ring"},
        idempotency_key="consult-0001",
    )
    print(result)  # sandbox keys return {"sandbox": true, ...} and contact nobody
except AdaApiError as exc:
    print(exc.status, exc.error, exc.error_description, exc.documentation_url)

Methods

Method Endpoint
diamonds(**filters) GET /api/v1/diamonds
diamond(id) GET /api/v1/diamonds/{id}
engagement_rings(**filters) GET /api/v1/engagement-rings
engagement_ring(slug) GET /api/v1/engagement-rings/{slug}
jewelry(**filters) GET /api/v1/jewelry
jewelry_item(slug) GET /api/v1/jewelry/{slug}
knowledge_base(q=None) GET /api/v1/knowledge-base
article(slug) GET /api/v1/knowledge-base/{slug}
showrooms() GET /api/v1/showrooms
request_consultation(payload, idempotency_key=None) POST /api/v1/consultations
create_key(name, env="sandbox") POST /api/v1/keys
batch(requests) POST /api/v1/batch
ask(query) GET /ask (NLWeb)
request(method, path, params=None, body=None, headers=None) any endpoint

Errors raise AdaApiError with status, error, error_description, documentation_url, and retry_after_seconds (on 429). After every call client.last_rate_limit holds the RateLimit-* headers and client.last_headers the full header map.

Pass base_url= to point at another host, for example a preview deployment.

Also available

Support

Developer questions: it@adadiamonds.com. Automated bulk scraping of the site is not permitted; this API is the supported way to read the catalog.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ada_diamonds-1.0.1.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ada_diamonds-1.0.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file ada_diamonds-1.0.1.tar.gz.

File metadata

  • Download URL: ada_diamonds-1.0.1.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.0

File hashes

Hashes for ada_diamonds-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e2c257260392ccc66d4fbc0d46bf8fbbe5bf2cbe518cf0f739ef718e0fd30f0f
MD5 b0791878b4a46697b3a7df7306f593e3
BLAKE2b-256 f30420857479d35a3a41567360ce01b772e8d9eb2877f7de737a2519772a6792

See more details on using hashes here.

File details

Details for the file ada_diamonds-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: ada_diamonds-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.0

File hashes

Hashes for ada_diamonds-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 55d597d76bed02cb82201ec5b83de20dc6d7be7f8ea0bae7776d8a6de851dfb8
MD5 6ae9b414b278dcd17c411df60167186f
BLAKE2b-256 e86e8a51838e6eea5c7b364231d22dc323304cd92f71e70056ad468686ab376e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page