SDKs
Official TypeScript and Python SDKs for the Fiber AI API — typed requests, typed responses, and credit costs on every call.
SDKs
Official SDKs exist for TypeScript/JavaScript (@fiberai/sdk) and
Python (fiberai). Every call returns fully typed results plus a
chargeInfo field that is authoritative for what a request cost — you
never have to guess your spend. See Billing & credits for
credit pricing.
Building with an AI agent? Don't paste from memory — point your agent at the canonical docs: llms.txt for routing rules, ai-docs/index.md for every operation, and Developing with AI agents for plugin and MCP setup.
Authentication
All requests need an API key from
fiber.ai/app/api — keys start with sk_live_.
Pass it in the request body for POST calls and as a query parameter
for GET calls. Keep it in an environment variable (FIBERAI_API_KEY), never
in source.
TypeScript SDK
Install (Node.js 18+):
npm install @fiberai/sdkSearch companies:
import { companySearch } from '@fiberai/sdk';
const result = await companySearch({
body: {
apiKey: process.env.FIBERAI_API_KEY!,
searchParams: {
industriesV2: { anyOf: ['Software'] },
// employeeCountV2 bounds are bucketed.
// Allowed values: 0 | 1 | 10 | 50 | 200 | 500 | 1000 | 5000 | 10000 | null
employeeCountV2: {
lowerBoundExclusive: 50,
upperBoundInclusive: 500,
},
headquartersCountryCode: { anyOf: ['USA'] },
},
pageSize: 10,
},
});
console.log(`Found ${result.data?.output.data.length} companies`);
console.log('Cost:', result.data?.chargeInfo);Search people by title and country:
import { peopleSearch } from '@fiberai/sdk';
const people = await peopleSearch({
body: {
apiKey: process.env.FIBERAI_API_KEY!,
searchParams: {
jobTitleV2: {
anyOf: [
{ type: 'term', term: 'CEO' },
{ type: 'term', term: 'CTO' },
{ type: 'static-groups', groups: ['c-suite'] },
],
},
country3LetterCode: { anyOf: ['USA'] },
},
pageSize: 25,
},
});Reveal contacts (sync, fast — see Contact Reveal for all tiers):
import { syncQuickContactReveal } from '@fiberai/sdk';
const result = await syncQuickContactReveal({
body: {
apiKey: process.env.FIBERAI_API_KEY!,
linkedinUrl: 'https://www.linkedin.com/in/example',
enrichmentType: {
getWorkEmails: true,
getPersonalEmails: false,
getPhoneNumbers: true,
},
},
});
console.log('Emails:', result.data?.output.profile.emails);
console.log('Cost:', result.data?.chargeInfo);For bulk rows use startBatchContactDetails → pollBatchContactDetails, and
pick up the finished job with a webhook.
Check credits (free):
import { getOrgCredits } from '@fiberai/sdk';
const credits = await getOrgCredits({ query: { apiKey: process.env.FIBERAI_API_KEY! } });
console.log(`Available: ${credits.data?.output.available}`);Error handling. SDK functions return { data, error, response } — check
error before reading data, or pass throwOnError: true to throw on
non-2xx instead:
if (result.error) {
console.error(`HTTP ${result.response.status}:`, result.error);
} else {
console.log(`${result.data.output.data.length} companies`);
}| Code | Meaning | What to do |
|---|---|---|
| 401 | Unauthorized | Check your API key |
| 402 | Payment required | Top up credits (see billing) |
| 429 | Too many requests | Slow down — you hit the rate limit |
| 500 | Server error | Contact support |
Python SDK
Install (Python 3.9+):
pip install fiberaiEvery operation has .sync() and .asyncio() variants:
import asyncio
import os
from fiberai import Client
from fiberai.api.search import company_search
from fiberai.models import CompanySearchBody
client = Client(base_url="https://api.fiber.ai")
body = CompanySearchBody.from_dict({
"apiKey": os.environ["FIBERAI_API_KEY"],
"searchParams": {
"industriesV2": {"anyOf": ["Software"]},
"employeeCountV2": {
"lowerBoundExclusive": 50,
"upperBoundInclusive": 500,
},
"headquartersCountryCode": {"anyOf": ["USA"]},
},
"pageSize": 10,
})
result = company_search.sync(client=client, body=body)Reveal contacts:
from fiberai.api.contact_details import sync_quick_contact_reveal
result = sync_quick_contact_reveal.sync(client=client, body={
"apiKey": os.environ["FIBERAI_API_KEY"],
"linkedinUrl": "https://www.linkedin.com/in/example",
"enrichmentType": {
"getWorkEmails": True,
"getPersonalEmails": False,
"getPhoneNumbers": True,
},
})Error handling — the non-detailed call returns a discriminated union;
narrow with isinstance:
if isinstance(result, CompanySearchResponse200):
companies = result.output.data
elif isinstance(result, CompanySearchResponse402):
raise RuntimeError("out of credits")
elif isinstance(result, CompanySearchResponse429):
raise RuntimeError("rate limited; back off and retry")Set raise_on_unexpected_status=True on the client to also raise on
transient 5xx.
Module map:
| Module | What's in it |
|---|---|
fiberai.api.search | Company, people, investor, investment, and job-posting search |
fiberai.api.live_fetch | Real-time LinkedIn fetches for profiles and companies |
fiberai.api.contact_details | Email + phone reveal (all tiers and batch) |
fiberai.api.agentic_search | Text-to-search: job descriptions and free text → profiles |
fiberai.api.kitchen_sink | Bulk identifier-based lookup (see Kitchen Sink) |
fiberai.api.google_maps | Google Maps business search (async) |
fiberai.api.email_lookup | Reverse email lookup (see Reverse Email Lookup) |
fiberai.api.exclusions | Company & prospect exclusion lists |
fiberai.api.account | Credits, auto-top-up settings, credit purchase |
fiberai.api.enums | Industries, NAICS, regions, languages, accelerators |
fiberai.api.typeaheads | Company & location autocomplete |
fiberai.api.validation | Email bounce detection |
fiberai.api.utility | Health check and OpenAPI download (no key needed) |
Resources
- TypeScript: npm
@fiberai/sdk· GitHub - Python: PyPI
fiberai· GitHub - API reference · Get an API key
Hotels API
Search hotels and vacation rentals the way you would on Google Hotels or Expedia — then open a property for rates, amenities, and booking offers.
MCP for AI agents
Connect Fiber to Claude, ChatGPT, Cursor, Claude Code, Codex, VS Code, and Windsurf via Model Context Protocol (MCP) — search companies, enrich contacts, and check credits from your agent.