Registry / ai-ml / cardsightai

cardsightai

JSON →
library3.6.0jsnpmunverified

Official TypeScript/JavaScript SDK for the CardSight AI REST API, providing comprehensive baseball card identification and collection management. Version 3.6.0 ships with full TypeScript types and dual ESM/CJS support. Released under MIT license with a free tier, it covers 100% of the CardSight AI API endpoints including card identification, detection, catalog search, collections, pricing, and AI-powered search. Key differentiators include multi-card detection, flexible metadata fields across trading card games, and minimal dependencies (only openapi-fetch). Requires Node.js 20+ and TypeScript 5+ (optional).

npm install cardsightai
INSTALL
IMPORT
SIG · CARDSIGHTAI
C
cardsightai
ai-mljavascriptv3.6.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CardSightAI
import { CardSightAI } from 'cardsightai'
import CardSightAI from 'cardsightai'
CardSightAI is a named export, not a default export. ESM-only for Node.js 20+ using native fetch.
CardSightAIClient
import { CardSightAIClient } from 'cardsightai/client'
import { CardSightAI } from 'cardsightai/client'
CardSightAIClient is exported from a subpath for advanced use cases.
CardSightAIError
import { CardSightAIError } from 'cardsightai'
import { CardSightAIError } from 'cardsightai/errors'
CardSightAIError is a top-level export for error handling.

Initialize CardSight AI client and identify cards from an image URL using the AI-powered identification API.

import { CardSightAI } from 'cardsightai'; const client = new CardSightAI({ apiKey: process.env.CARDSIGHT_API_KEY ?? '' }); async function identifyCards() { const imageUrl = 'https://example.com/card-image.jpg'; const result = await client.identify.card({ imageUrl }); console.log(result.cards); } identifyCards().catch(console.error);
Debug
Known issues
breakingv3.0.0 changed the client constructor signature from positional arguments to a config object.
fix
Use `new CardSightAI({ apiKey: '...' })` instead of `new CardSightAI('...')`.
affects: >=3.0.0
breakingv2.0.0 removed the legacy 'identify' method; use 'identify.card' instead.
fix
Replace `client.identify(url)` with `client.identify.card({ imageUrl: url })`.
affects: >=2.0.0
gotchaAll API methods return Promises and must be awaited.
fix
Use `await` or `.then()` on all calls.
affects: *
gotchaThe SDK uses native fetch and requires Node.js 20.0.0 or higher. It will not work in Node 18 or below.
fix
Upgrade Node.js to 20+ or use a polyfill for fetch.
affects: >=3.0.0
gotchaRate limits apply; check the API response headers for rate limit information.
fix
Handle 429 status codes with retry logic.
affects: *
deprecatedThe `catalog.search()` method is deprecated in favor of `catalog.cards.list()`.
fix
Switch to `catalog.cards.list()` with query parameters.
affects: >=3.5.0
Errors
Common errors & fixes
TypeError: fetch is not defined
Node.js version <20 does not have native fetch.
fix
Upgrade to Node.js 20+ or use a fetch polyfill like 'node-fetch' and configure global fetch.
CardSightAI is not a constructor
Incorrect import: using default import instead of named import.
fix
Use `import { CardSightAI } from 'cardsightai'` (curly braces).
Error: API key is required
Missing or empty apiKey in configuration.
fix
Set the `CARDSIGHT_API_KEY` environment variable or pass `apiKey` in the constructor.
TypeError: client.identify is not a function
Incorrect method name; 'identify' is an object, not a function.
fix
Use `client.identify.card(...)` or `client.identify.cardBySegment(...)`.
Upgrade
Version history
3.6.0latest on npm
Audit
Dependencies
openapi-fetchrequiredHTTP client for making API requests
Agent activity
24 hits · last 30 days
node
20
OpenAI (training)
1
Resources
cardsightai — npm install cardsightai · libregistry