Python & npm libraries
Our SDKs handle authentication, token renewal, request types, and common enrichment workflows so your team can focus on the customer experience around them.
Enrich records in real time
Section titled “Enrich records in real time”npm install @infiniteaudience/sdk@alphaimport { InfiniteAudience } from '@infiniteaudience/sdk';
const client = new InfiniteAudience({ apiKey: process.env.IA_API_KEY! });const result = await client.match.microbatch( { fieldList: ['birth_generation', 'estimated_household_income'] },);console.log(result.byRowId('customer-1'));pip install infiniteaudience==0.1.0a1import osfrom infinite_audience import InfiniteAudience
client = InfiniteAudience(api_key=os.environ["IA_API_KEY"])result = client.match.microbatch( field_list=["birth_generation", "estimated_household_income"],)print(result.by_row_id("customer-1"))Enrich a customer file
Section titled “Enrich a customer file”The file workflow keeps the multi-step upload, matching, delivery, and download process in one readable sequence.
import { readFile } from 'node:fs/promises';import { InfiniteAudience } from '@infiniteaudience/sdk';
const client = new InfiniteAudience({ apiKey: process.env.IA_API_KEY! });const csv = await readFile('./customers.csv');
const job = await client.match.file.create({ name: 'Spring customers', file_format: 'csv',});await client.match.file.upload(job, [csv]);await client.match.file.wait(job.match_id);
const delivery = await client.deliveries.create(job.match_id, { include_unmatched: true,});const finished = await client.deliveries.wait(job.match_id, delivery.delivery_id);const downloadUrls = client.deliveries.download(finished);import osfrom pathlib import Pathfrom infinite_audience import InfiniteAudience
client = InfiniteAudience(api_key=os.environ["IA_API_KEY"])csv = Path("customers.csv").read_bytes()
job = client.match.file.create(name="Spring customers", file_format="csv")client.match.file.upload(job, [csv])client.match.file.wait(job["match_id"])
delivery = client.deliveries.create(job["match_id"], include_unmatched=True)finished = client.deliveries.wait(job["match_id"], delivery["delivery_id"])download_urls = client.deliveries.download(finished)Handle the errors that matter
Section titled “Handle the errors that matter”Both libraries turn common API failures into named error classes: insufficient balance, postpay ceiling, rate limits, idempotency conflicts, file-analysis failures, and a general API fallback. Catch only the cases your workflow can recover from and let the rest reach your normal application error handling.
import { FileAnalysisError, IdempotencyConflict, InsufficientBalance, RateLimited,} from '@infiniteaudience/sdk';from infinite_audience import ( FileAnalysisError, IdempotencyConflict, InsufficientBalance, RateLimited,)Both libraries support small record batches, file workflows, delivery status, typed errors, and API-key or OAuth authentication.
For the complete request and response shapes, use the API reference.
