This is an unofficial JavaScript/TypeScript SDK for Numista. It can run in both browsers and servers.
npm install @leopiccionia/numista-sdk
Before starting, you'll need a Numista API key (get one here).
import { NumistaConnector } from '@leopiccionia/numista-sdk'
const numista = new NumistaConnector(YOUR_API_KEY, YOUR_CLIENT_ID, { defaultLanguage: 'en' })
// Get the Morgan Dollar
const morganDollar = await numista.type(1492)
// Get the Peace Dollar
const peaceDollar = await numista.code('KM', '150', { issuer: 'united-states' })
// Get all American coins depicting a buffalo
const buffalos = await numista.searchCoins('buffalo', { issuer: 'united-states' })
- Great type-safety and IntelliSense support
Promise
-based APIs, designed forasync
/await
- Proper error handling:
- The connector returns
RequestError
if the connection with the server failed - The connector returns
ResponseError
if the server responded with an error message
- The connector returns