Jan 6, 2026 · Updated Nov 3, 2026

<span aria-hidden="true" id="lets-build-ai-business-card-scanner-with-transloadit"></span>

# Let's Build: AI business card scanner with Transloadit

![Kevin van Zonneveld](/assets/images/teammates/avatar-kvz-4.jpg)

**Kevin van Zonneveld**

Co-founder · Amsterdam, The Netherlands · Show bio

[](https://x.com/kvz)[](https://github.com/kvz)

Turn a business card image or PDF into a local JSON file of contact details. This TypeScript example uploads one card to Transloadit, asks an AI model to extract the visible fields, and saves the result for you to compare with the original before adding a contact to your CRM.

<span aria-hidden="true" id="what-were-building"></span>

## What we’re building

* Accept a PNG/JPEG card image or a PDF.
* Optimize images with [🤖 /image/optimize](/docs/robots/image-optimize.md), while PDFs go directly to the extraction Step.
* Extract contact fields with [🤖 /ai/chat](/docs/robots/ai-chat.md) and download the JSON result.

This is a local command-line example, not a camera app. You need a Transloadit Workspace Auth Key and Secret, an explicit AI credential choice, and permission to send the card to Transloadit and Anthropic. Processing is billed, including the AI test-credentials option. Start with a synthetic card without anyone’s personal data.

<span aria-hidden="true" id="schema-first-zod"></span>

## Schema first (zod)

The [example script](/example%5Fapps/business-card-scanner/run.ts) exports `businessCardSchema` so you can reuse the same contract instead of maintaining a second field list. Its optional fields are `full_name`, `title`, `company`, `email`, `phones`, `address`, `website`, `socials`, and `notes`. Phone numbers stay strings so a leading `+` is preserved. Unknown fields should be omitted.

After the setup below, save this as `schema.ts` in your project directory and run `node schema.ts` to inspect the schema sent to the model:

```ts
import { zodToJsonSchema } from 'zod-to-json-schema'

import { businessCardSchema } from './business-card-scanner/run.ts'

console.log(JSON.stringify(zodToJsonSchema(businessCardSchema), null, 2))

```

A schema checks field types; it cannot establish whether a name or email was read correctly. The runner rejects malformed JSON, schema-invalid output, and an object with no recognized fields. A nonempty, schema-valid result still needs review against the card.

<span aria-hidden="true" id="pipeline-overview"></span>

## Pipeline overview

|Input|Processing path|
|-|-|
|PDF card|`/ai/chat`|
|PNG/JPEG card|`/image/optimize` → `/ai/chat`|

The file filters route PDFs separately from images. Despite its `pdf_verified` name, the PDF filter only selects the reported MIME type; it does not prove that a document is intact or readable.

<span aria-hidden="true" id="assembly-snippet"></span>

## Assembly snippet

The app’s exported recipe supplies the filters, prompt, schema, and `anthropic/claude-sonnet-4-6` model. To inspect its Assembly Instructions, save this as `instructions.ts` beside `schema.ts` and run `node instructions.ts`:

```ts
import { example } from './business-card-scanner/run.ts'

const steps = example.steps({ test_credentials: true })
console.log(JSON.stringify({ steps }, null, 2))

```

This only prints the recipe. The CLI below submits it, waits for completion, downloads the result, validates it, and saves the contact fields locally. The local file is what you keep; the processing result URL is temporary.

<span aria-hidden="true" id="try-the-example-app"></span>

## Try the example app

Use [Node.js 26.12.1](https://nodejs.org/en/blog/release/v26.12.1/), separately installed [Corepack](https://yarnpkg.com/corepack), cURL, and a new empty directory outside an existing project. Follow the [setup instructions](/example%5Fapps/business-card-scanner/README.md) to install Yarn 4.12.0, `@transloadit/node` 4.14.0, Zod 3.25.76, and `zod-to-json-schema` 3.25.2, and download both `business-card-scanner/run.ts` and `shared/runtime.ts`. Keep that directory layout: the app imports the shared runtime. No private repository checkout is needed.

These are tested versions. The example retains Zod 3 and its converter; [zod-to-json-schema is deprecated](https://github.com/StefanTerdell/zod-to-json-schema), and Zod 4 has native JSON Schema support. Upgrading that contract is a separate change to the app.

In the shell where you will run the program, replace these placeholders with your Workspace values:

```bash
export TRANSLOADIT_AUTH_KEY='YOUR_AUTH_KEY'
export TRANSLOADIT_AUTH_SECRET='YOUR_AUTH_SECRET'

```

Keep secrets out of source control and browser code. The program reads the process environment; it does not load an environment file or create credentials.

Place your card at `card.png` in the project directory, or replace the input path. Choose an output that does not exist, then explicitly authorize billed AI test credentials:

```bash
node business-card-scanner/run.ts --input ./card.png --output ./result.json --test-credentials

```

Alternatively, set `TRANSLOADIT_AI_CREDENTIALS` to the name of an existing Anthropic AI Credential and omit `--test-credentials`. Select exactly one mode. See the setup instructions for configuring your own provider credential before running the app.

On success, open `result.json` and compare the extracted name, email, and phone numbers with the card. Missing optional fields are allowed. The app leaves the input unchanged and refuses an existing output before submitting work, so use a new destination for another run. It limits input and downloaded output to 20 MiB, waits up to five minutes for processing, and gives the result download a separate 30-second deadline. These are example limits, not product limits.

If a run fails after printing an Assembly ID, inspect that Assembly in the Console before retrying. A timeout or interruption does not prove remote processing stopped, and the work can still be billed. The script does not automatically retry an Assembly.

<span aria-hidden="true" id="example-inputs"></span>

## Example inputs

Use a readable synthetic card with a name, company, email, and phone number you can check. Run a single card per file; for a PDF, start with one page. To exercise the PDF path, pass its filename to the same command and choose a second JSON output. A successful image extraction does not establish that a particular PDF is readable, and image optimization does not guarantee better recognition.

<span aria-hidden="true" id="next-steps"></span>

## Next steps

Review every extraction before inserting contacts into your CRM. The schema returns no confidence scores, so it cannot select “low-confidence” contacts for you. After review, normalize phone numbers and addresses per locale and deduplicate contacts using your CRM’s rules.

[#letsbuild](/blog/tags/letsbuild.md)[#ai](/blog/tags/ai.md)[#image-processing-service](/blog/tags/image-processing-service.md)[#artificial-intelligence-service](/blog/tags/artificial-intelligence-service.md)[#developer-experience](/blog/tags/developer-experience.md)

### Join 25k+ developers

Sign up for our [monthly newsletter](/newsletters.md) to receive direct links to 3 exclusive tech — and 2 product updates. No less, no more.

Email address

Subscribe

One email a month. Unsubscribe anytime.

## File uploading and encoding. Made simple.

Trusted by Coursera and The New York Times for a reliable API, top-notch support, and open source like [Uppy](https://uppy.io) and [Tus](https://tus.io).

[Try it free](/c/signup/)[Request a demo](/request-demo.md)

No credit card needed · Cancel anytime
