SDKs

Official clients with typed request/response shapes, built-in retry logic for 429/5xx, and environment-variable conventions. You can also generate a client from our OpenAPI spec for any other language.

TypeScript / Node

bash
# npm
npm install @mentionsapi/sdk

# pnpm
pnpm add @mentionsapi/sdk

# bun
bun add @mentionsapi/sdk

Package name: @mentionsapi/sdk. Import: import { MentionsAPIClient } from "@mentionsapi/sdk";. The client is a single class; every endpoint is a method.

Python

ask.py
# pip install mentionsapi  (forthcoming on PyPI)
# Today: clone packages/sdk-python and install locally.

import os
from mentionsapi import MentionsAPIClient

client = MentionsAPIClient(api_key=os.environ["MENTIONSAPI_KEY"])

res = client.ask(
    prompt="Best PostgreSQL hosting in 2026?",
    providers=["openai", "anthropic", "perplexity"],
    track_brands=["Supabase", "Neon"],
    web_search=True,
)

for p in res["providers"]:
    if "error" in p:
        print(p["provider"], "failed:", p["error"]["code"])
    else:
        print(p["provider"], "→", p["content"][:120])

print("cost:", res["usage"]["cost_cents"], "cents")

The Python SDK lives at packages/sdk-python in the open-source repo. PyPI publication is coming in a follow-up release.

Generate your own client

The OpenAPI 3.1 spec is served at https://api.mentionsapi.com/openapi.json. Point openapi-generator-cli, Orval, Hey API, or any OpenAPI-aware generator at it — the spec is regenerated from the live Zod schemas on every deploy.