# Official SDKs

Both are named `tickermint`, have no dependencies, are typed, read `TICKERMINT_API_KEY` from the environment and build the link back for you. MIT licensed; source and issues: https://github.com/seankarltonlee/tickermint-examples.

## JavaScript / TypeScript

```sh
npm install https://tickermint.cards/sdk/tickermint-0.2.1.tgz
```

```ts
import { TickerMint, cardUrl } from "tickermint";
const tm = new TickerMint(); // reads TICKERMINT_API_KEY; works without a key to try it
const [card] = await tm.search("charizard ex 199/165", { game: "pokemon" });
const history = await tm.prices(card.product_id);
console.log(card.name, card.market, cardUrl(card.product_id));
```

## Python

```sh
pip install https://tickermint.cards/sdk/tickermint-0.2.1-py3-none-any.whl
```

```python
from tickermint import TickerMint, TickerMintError, card_url
tm = TickerMint()  # reads TICKERMINT_API_KEY
card = tm.search("charizard ex 199/165", game="pokemon")[0]
print(card["name"], card["market"], card_url(card["product_id"]))
```

Errors raise `TickerMintError` with `status`, `detail`, `retry_after` and, from version 0.2.0, `code`, `required_plan`, `upgrade_url` and `docs_url` (see https://tickermint.cards/docs/errors.md).

Raw HTTP is fine too: the API is plain GET + JSON (https://tickermint.cards/docs/quickstart.md). OpenAPI for client generators: https://api.tickermint.cards/openapi.json
