### Install Fiber AI SDK (Python) Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/cursor/commands/fiber-setup.md Install the Fiber AI SDK for Python projects using pip. ```bash pip install fiberai ``` -------------------------------- ### Install Fiber AI Skills via skills.sh Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/README.md Install individual Fiber AI skills for agents that support skills.sh. This example shows how to add the 'search' skill. ```bash npx skills add fiber-ai/fiber-ai-plugin --skill search ``` ```bash npx skills add fiber-ai/fiber-ai-plugin --skill enrich ``` ```bash npx skills add fiber-ai/fiber-ai-plugin --skill audience ``` ```bash npx skills add fiber-ai/fiber-ai-plugin --skill sdk-ts ``` ```bash npx skills add fiber-ai/fiber-ai-plugin --skill sdk-py ``` ```bash npx skills add fiber-ai/fiber-ai-plugin --skill setup ``` ```bash npx skills add fiber-ai/fiber-ai-plugin --skill help ``` -------------------------------- ### Installation Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/sdk-py/references/client-setup.md Install the Fiber AI Python SDK using pip. ```APIDOC ## Installation ```bash pip install fiberai ``` ``` -------------------------------- ### Install Fiber AI SDK (Node.js) Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/cursor/commands/fiber-setup.md Install the Fiber AI SDK for Node.js projects using npm. ```bash npm install @fiberai/sdk ``` -------------------------------- ### Quick Fiber AI Setup Verification Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/setup/SKILL.md Run this command to quickly test your Fiber AI setup and confirm that search functionality is working. ```bash /fiber:search "technology companies in San Francisco" ``` -------------------------------- ### Example Search Body Structure Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/search/SKILL.md This is an example of the request body structure for search operations. Always verify exact field names using `get_endpoint_details_full`. ```json { "apiKey": "...", "searchParams": { ... }, "pageSize": 25, "cursor": null } ``` -------------------------------- ### Install Fiber AI Plugin for Cursor Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/README.md Use these commands to install the Fiber AI plugin for Cursor, enabling project-scoped MCP tools, skills, rules, and slash commands. ```bash cursor-plugin marketplace add fiber-ai/fiber-ai-plugin --scope project cursor-plugin install fiber-ai --scope project ``` -------------------------------- ### Making API Calls - Get Organization Credits Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/sdk-ts/references/client-setup.md Example of making a GET request to check organization credits. The API key is passed in the query parameters. ```typescript import { createClient, getOrgCredits } from "@fiberai/sdk"; const client = createClient({ baseUrl: "https://api.fiber.ai", }); const credits = await getOrgCredits({ client, query: { apiKey: process.env.FIBER_API_KEY!, }, }); ``` -------------------------------- ### Install Fiber AI Plugin for Cursor Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Install the Fiber AI plugin for Cursor via the marketplace or use deeplinks for V2 or Core MCP servers. Ensure your API key is configured. ```bash cursor-plugin marketplace add fiber-ai/fiber-ai-plugin --scope project cursor-plugin install fiber-ai --scope project # Or add via deeplink (paste in browser): # V2: cursor://anysphere.cursor-deeplink/mcp/install?name=fiber-ai-v2&config=eyJ0eXBlIjoiaHR0cCIsInVybCI6Imh0dHBzOi8vbWNwLmZpYmVyLmFpL21jcC92MiJ9 # Core: cursor://anysphere.cursor-deeplink/mcp/install?name=fiber-ai-core&config=eyJ0eXBlIjoiaHR0cCIsInVybCI6Imh0dHBzOi8vbWNwLmZpYmVyLmFpL21jcCJ9 ``` -------------------------------- ### Install Fiber AI MCP via Cursor Deeplink (v2) Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/README.md Install the Core MCP server for Cursor using this deeplink. This provides access to all 100+ endpoints via meta-tools. ```deeplink cursor://anysphere.cursor-deeplink/mcp/install?name=fiber-ai-v2&config=eyJ0eXBlIjoiaHR0cCIsInVybCI6Imh0dHBzOi8vbWNwLmZpYmVyLmFpL21jcC92MiJ9 ``` -------------------------------- ### Install Fiber AI Plugin for Claude Code Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Install the Fiber AI plugin and configure all MCP tools, skills, and hooks for project scope. Remember to set your FIBER_API_KEY environment variable. ```bash claude plugin marketplace add fiber-ai/fiber-ai-plugin --scope project claude plugin install fiber --scope project # Set your API key (get it at https://fiber.ai/app/api) export FIBER_API_KEY=sk_live_... # Verify setup — check credits balance # Run /fiber:setup to confirm connection ``` -------------------------------- ### Install Fiber AI Core MCP via Cursor Deeplink Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/README.md Install the Core MCP server for Cursor using this deeplink. This provides access to all 100+ endpoints via meta-tools. ```deeplink cursor://anysphere.cursor-deeplink/mcp/install?name=fiber-ai-core&config=eyJ0eXBlIjoiaHR0cCIsInVybCI6Imh0dHBzOi8vbWNwLmZpYmVyLmFpL21jcCJ9 ``` -------------------------------- ### Quick Start: Company Search with Fiber AI SDK Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/sdk-ts/SKILL.md Initialize the Fiber AI client and perform a company search. Ensure your API key is stored in environment variables and handle potential errors. ```typescript import { createClient, companySearch } from "@fiberai/sdk"; const client = createClient({ baseUrl: "https://api.fiber.ai", }); const result = await companySearch({ client, body: { apiKey: process.env.FIBER_API_KEY!, searchParams: { /* filters */ }, pageSize: 25, }, }); ``` -------------------------------- ### Check Account Credits (MCP) Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Example of checking organization credits using the Core MCP (Meta-Command Processor) with a specified API key. ```json call_operation("getOrgCredits", { "query": { "apiKey": "sk_live_..." } }) ``` -------------------------------- ### Install Fiber AI Plugin for Claude Code Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/README.md Use this command to add the Fiber AI plugin to your Claude Code environment for project scope. ```bash claude plugin marketplace add fiber-ai/fiber-ai-plugin --scope project claude plugin install fiber --scope project ``` -------------------------------- ### Company Search (Synchronous) Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/sdk-py/SKILL.md This example demonstrates how to perform a synchronous company search using the Fiber AI Python SDK. It shows the import statements, client initialization, and the call to the `company_search_sync` function with necessary parameters. ```APIDOC ## Company Search (Synchronous) ### Description Performs a synchronous company search using the Fiber AI API. ### Method `fiberai.api.search.company_search.sync` ### Parameters - `client`: An instance of `fiberai.Client` or `fiberai.AuthenticatedClient`. - `body`: A `fiberai.models.company_search_body.CompanySearchBody` object containing the request parameters. ### Request Body Example ```json { "api_key": "your_api_key", "search_params": {}, "page_size": 25 } ``` ### Response Example (Response structure depends on the API's output for company search) ``` -------------------------------- ### Company Search (Asynchronous) Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/sdk-py/SKILL.md This example shows how to perform an asynchronous company search using the Fiber AI Python SDK. It highlights the use of `asyncio` variants and `await` for non-blocking operations. ```APIDOC ## Company Search (Asynchronous) ### Description Performs an asynchronous company search using the Fiber AI API. ### Method `fiberai.api.search.company_search.asyncio` ### Parameters - `client`: An instance of `fiberai.Client` or `fiberai.AuthenticatedClient`. - `body`: A `fiberai.models.company_search_body.CompanySearchBody` object containing the request parameters. ### Request Body Example ```json { "api_key": "your_api_key", "search_params": {}, "page_size": 25 } ``` ### Response Example (Response structure depends on the API's output for company search) ``` -------------------------------- ### TypeScript SDK - Get Organization Credits Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Demonstrates how to retrieve the organization's available credits using the TypeScript SDK. The API key is passed as a query parameter. ```APIDOC ## Get Organization Credits (TypeScript SDK) ### Description Retrieves the number of available credits for your organization. ### Method GET ### Endpoint `/getOrgCredits` (via SDK client) ### Parameters #### Query Parameters - **apiKey** (string) - Required - Your Fiber AI API key. ### Request Example ```typescript const credits = await getOrgCredits({ client, query: { apiKey } }); ``` ### Response #### Success Response (200) - **data** (object) - Contains credit information. - **availableCredits** (number) - The number of credits available. ``` -------------------------------- ### Making API Calls - Company Search Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/sdk-ts/references/client-setup.md Example of making a POST request for company search. The API key and search parameters are passed in the request body. ```typescript import { createClient, companySearch } from "@fiberai/sdk"; const client = createClient({ baseUrl: "https://api.fiber.ai", }); const results = await companySearch({ client, body: { apiKey: process.env.FIBER_API_KEY!, searchParams: { // Use https://api.fiber.ai/docs/ for current filter schema }, pageSize: 25, }, }); ``` -------------------------------- ### Make API Calls with Fiber AI SDK Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/sdk-ts/references/client-setup.md Import specific API operations and use the client instance with request bodies. API keys are passed in the query for GET requests and in the body for POST requests. ```typescript import { createClient, companySearch, getOrgCredits } from "@fiberai/sdk"; const client = createClient({ baseUrl: "https://api.fiber.ai", }); // Check credits (GET endpoint — apiKey in query) const credits = await getOrgCredits({ client, query: { apiKey: process.env.FIBER_API_KEY!, }, }); // Company search (POST endpoint — apiKey in body) const results = await companySearch({ client, body: { apiKey: process.env.FIBER_API_KEY!, searchParams: { // Use https://api.fiber.ai/docs/ for current filter schema }, pageSize: 25, }, }); ``` -------------------------------- ### Paginate Search Results Using Cursor in TypeScript Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/sdk-ts/references/search-examples.md This example demonstrates how to handle cursor-based pagination for search results. It iteratively fetches data until no more cursors are returned, collecting all results. ```typescript import { createClient, companySearch } from "@fiberai/sdk"; const client = createClient({ baseUrl: "https://api.fiber.ai" }); const apiKey = process.env.FIBER_API_KEY!; async function searchAllCompanies(searchParams: Record) { const allResults: unknown[] = []; let cursor: string | null = null; do { const response = await companySearch({ client, body: { apiKey, searchParams, pageSize: 25, ...(cursor ? { cursor } : {}), }, }); if (response.data) { allResults.push(...(response.data as any).results); cursor = (response.data as any).cursor ?? null; } else { cursor = null; } } while (cursor); return allResults; } ``` -------------------------------- ### Start Batch Contact Enrichment Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Initiates an asynchronous batch enrichment process for multiple contacts. The request body should contain the necessary parameters for batch processing. ```json call_operation("startBatchContactEnrichment", { "body": { ... } }) ``` -------------------------------- ### Batch Enrichment with Rate Limiting in TypeScript SDK Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/sdk-ts/references/enrichment-examples.md Enrich multiple contacts in a batch while respecting rate limits by introducing a delay between requests. This example iterates through a list of LinkedIn URLs, performs enrichment, and handles potential errors. Adjust the `delayMs` parameter as needed. ```typescript import { createClient, syncContactEnrichment } from "@fiberai/sdk"; const client = createClient({ baseUrl: "https://api.fiber.ai" }); const apiKey = process.env.FIBER_API_KEY!; async function enrichBatch(linkedinUrls: string[], delayMs = 200) { const results = []; for (const url of linkedinUrls) { try { const result = await syncContactEnrichment({ client, body: { apiKey, linkedinUrl: url, enrichmentType: { // Specify enrichment types }, }, }); results.push({ url, data: result.data, error: null }); } catch (error) { results.push({ url, data: null, error: String(error) }); } // Respect rate limits await new Promise((resolve) => setTimeout(resolve, delayMs)); } return results; } ``` -------------------------------- ### Initialize Fiber AI Client (TypeScript) Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Set up the Fiber AI client with your base URL and enable automatic error raising for non-2xx responses. ```typescript import { createClient } from "@fiberai/sdk"; const client = createClient({ baseUrl: "https://api.fiber.ai", throwOnError: true, // throws on 401, 402, 429, etc. }); ``` -------------------------------- ### Initialize Fiber AI Client (Python) Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Instantiate the Fiber AI client for Python, specifying the base URL and enabling `raise_on_unexpected_status` for error handling. ```python from fiberai import Client client = Client( base_url="https://api.fiber.ai", raise_on_unexpected_status=True, # raises UnexpectedStatus on non-2xx ) ``` -------------------------------- ### Build Audience (Charges Credits) Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Initiates the audience building process, which charges credits. Always confirm with the user before executing this step. The status transitions from 'DRAFT' to 'BUILDING' and then to 'NORMAL' or 'FAILED'. ```json # Step 3 — Build (charges credits — CONFIRM with user first): call_operation("buildAudience", { "body": { "apiKey": "sk_live_..." }, "path": { "audienceId": "aud_abc123" } }) # Status: DRAFT → BUILDING → NORMAL (or FAILED) ``` -------------------------------- ### Create Fiber AI Client Instance Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/sdk-ts/references/client-setup.md Import and create a client instance using `createClient` with the base API URL. ```typescript import { createClient } from "@fiberai/sdk"; const client = createClient({ baseUrl: "https://api.fiber.ai", }); ``` -------------------------------- ### Check Organization Credits (TypeScript) Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Retrieve the number of available organization credits. The API key is passed in the query parameters for GET requests. ```typescript import { getOrgCredits } from "@fiberai/sdk"; const credits = await getOrgCredits({ client, query: { apiKey } }); console.log("Credits available:", credits.data); ``` -------------------------------- ### Get Fiber AI API Key Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/sdk-ts/references/client-setup.md A utility function to retrieve the API key from environment variables, throwing an error if it's not set. ```typescript function getApiKey(): string { const key = process.env.FIBER_API_KEY; if (!key) { throw new Error( "FIBER_API_KEY environment variable is required. Get your key at https://fiber.ai/app/api" ); } return key; } ``` -------------------------------- ### Trigger Audience Enrichment with Fiber AI Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/cursor/commands/fiber-audience.md Starts the enrichment process for an audience. This operation consumes credits and requires user confirmation before proceeding. ```python call_operation("triggerEnrichment", ...) ``` -------------------------------- ### Check Account Credits (Python) Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Synchronously retrieves the organization's credit balance. Requires an initialized client and an API key. ```python from fiberai.api.account.get_org_credits import sync as get_credits_sync credits = get_credits_sync(client=client, api_key=api_key) print(f"Credits: {credits}") ``` -------------------------------- ### Start Batch Contact Enrichment Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/enrich/SKILL.md Initiates asynchronous batch processing for enriching multiple contacts. For large-scale enrichment, consider the /fiber:audience workflow. ```python start_batch_contact_enrichment() ``` -------------------------------- ### Manually Check Response Status Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/sdk-py/references/client-setup.md Use the `sync_detailed` function to get the full `Response` object and manually check the status code and content for error handling. ```python from fiberai.api.search.company_search import sync_detailed response = sync_detailed(client=client, body=body) if response.status_code == 200: data = response.parsed else: print(f"Error {response.status_code}: {response.content}") ``` -------------------------------- ### Perform Async Company Search (Python) Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Asynchronously searches for companies. Requires an initialized client and a CompanySearchBody object containing the API key and search parameters. ```python from fiberai.api.search.company_search import asyncio as company_search_async async def search_async(): return await company_search_async( client=client, body=CompanySearchBody(api_key=api_key, search_params={}, page_size=25), ) ``` -------------------------------- ### Call syncContactEnrichment via Core MCP Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/enrich/SKILL.md Use this to enrich individual contact details. Always call get_endpoint_details_full first to get the exact parameter schema. ```python call_operation("syncContactEnrichment", {"body": {"apiKey": "...", "linkedinUrl": "...", "enrichmentType": {...}}}) ``` -------------------------------- ### Call kitchenSinkCompany via Core MCP Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/enrich/SKILL.md Use this for comprehensive company profile lookups. Call get_endpoint_details_full first to see the schema. ```python call_operation("kitchenSinkCompany", {"body": {...}}) ``` -------------------------------- ### Build Audience Operation Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/audience/SKILL.md Initiates the process of building the audience based on the set search parameters. This step consumes credits, so user confirmation is mandatory before execution. The audience status transitions from 'DRAFT' to 'BUILDING' and then to 'NORMAL' or 'FAILED'. ```json { "operationId": "buildAudience", "path": { "audienceId": "YOUR_AUDIENCE_ID" }, "body": { "apiKey": "YOUR_API_KEY" } } ``` -------------------------------- ### Company Search with Python SDK (Sync) Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Perform a synchronous company search using the Python SDK. Import the specific sync function and the corresponding request body model. ```python from fiberai.api.search.company_search import sync as company_search_sync from fiberai.models.company_search_body import CompanySearchBody result = company_search_sync( client=client, body=CompanySearchBody( api_key=api_key, search_params={ # Check https://api.fiber.ai/docs/ for current filter schema }, page_size=25, ), ) ``` -------------------------------- ### Poll Enrichment Status Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Polls the status of the audience enrichment process. Note that the API key is in the query string for GET requests during polling, with intervals of approximately 30 seconds. ```json # Step 7 — Poll enrichment status (every 30s, apiKey in QUERY STRING for GET): call_operation("getEnrichmentStatus", { "query": { "apiKey": "sk_live_..." }, "path": { "audienceId": "aud_abc123" } }) ``` -------------------------------- ### Fiber AI Search Error Codes Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Common error codes for Fiber AI search operations. A 401 error typically indicates an invalid API key, which can be resolved by running `/fiber:setup`. ```bash # Error codes: # 401 — invalid API key → run /fiber:setup ``` -------------------------------- ### Initialize Client with Auto-Error Raising Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/sdk-py/references/client-setup.md Initialize the client to automatically raise exceptions for non-2xx status codes. This simplifies error checking for common HTTP errors. ```python from fiberai import Client from fiberai.errors import UnexpectedStatus # Option 1: Auto-raise on non-2xx responses client = Client( base_url="https://api.fiber.ai", raise_on_unexpected_status=True, ) try: result = some_api_call(client=client, body=body) except UnexpectedStatus as e: # e.status_code, e.content available if e.status_code == 401: print("Invalid API key. Check FIBER_API_KEY.") elif e.status_code == 402: print("Insufficient credits. Top up at https://www.fiber.ai/app/subscription") elif e.status_code == 429: print("Rate limit exceeded. Retry after a moment.") ``` -------------------------------- ### Asynchronous Company Search with Fiber AI SDK Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/sdk-py/SKILL.md This snippet demonstrates how to perform an asynchronous company search using the SDK. It utilizes the `asyncio` variant of the API function and requires the FIBER_API_KEY environment variable. ```python import os from fiberai import Client from fiberai.api.search.company_search import asyncio as company_search_async from fiberai.models.company_search_body import CompanySearchBody client = Client(base_url="https://api.fiber.ai") result = await company_search_async( client=client, body=CompanySearchBody( api_key=os.environ["FIBER_API_KEY"], search_params={}, page_size=25, ), ) ``` -------------------------------- ### Initialize Unauthenticated Client Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/sdk-py/references/client-setup.md Initialize the unauthenticated client for making API calls. Ensure the base URL is correctly set. ```python import os from fiberai import Client client = Client(base_url="https://api.fiber.ai") ``` -------------------------------- ### Poll Enrichment Status Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/audience/SKILL.md Monitors the progress of the asynchronous enrichment process. Poll this endpoint every 30 seconds until completion and report the progress percentage to the user. Note that 'apiKey' is passed in the query string for GET requests. ```json { "operationId": "getEnrichmentStatus", "query": { "apiKey": "YOUR_API_KEY" }, "path": { "audienceId": "YOUR_AUDIENCE_ID" } } ``` -------------------------------- ### Synchronous Company Search with Fiber AI SDK Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/sdk-py/SKILL.md Use this snippet for performing a synchronous company search. Ensure the FIBER_API_KEY environment variable is set and import necessary modules. ```python import os from fiberai import Client from fiberai.api.search.company_search import sync as company_search_sync from fiberai.models.company_search_body import CompanySearchBody client = Client(base_url="https://api.fiber.ai") result = company_search_sync( client=client, body=CompanySearchBody( api_key=os.environ["FIBER_API_KEY"], search_params={}, # Check https://api.fiber.ai/docs/ for filter schema page_size=25, ), ) ``` -------------------------------- ### Python SDK - Company Search Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Shows how to perform a company search synchronously using the Python SDK. The API key and search parameters are part of the request body model. ```APIDOC ## Company Search (Python SDK - Sync) ### Description Performs a synchronous search for companies using the Python SDK. The request body is defined by the `CompanySearchBody` model. ### Method POST ### Endpoint `/search/company_search` (via SDK client) ### Parameters #### Request Body (`CompanySearchBody` model) - **api_key** (str) - Required - Your Fiber AI API key. - **search_params** (dict) - Optional - Filters for the company search. Refer to API documentation for schema. - **page_size** (int) - Optional - Number of results per page. Defaults to 25. ### Request Example ```python from fiberai.api.search.company_search import sync as company_search_sync from fiberai.models.company_search_body import CompanySearchBody result = company_search_sync( client=client, body=CompanySearchBody( api_key=api_key, search_params={ /* filters */ }, page_size=25, ), ) ``` ### Response #### Success Response (200) - **data** (dict) - Contains search results and pagination information. ``` -------------------------------- ### TypeScript SDK - Company Live Enrichment Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Explains how to perform live enrichment for company data using the TypeScript SDK. Requires either a domain or a LinkedIn URL. ```APIDOC ## Company Live Enrichment (TypeScript SDK) ### Description Performs live enrichment for company data. Provide either a company domain or a LinkedIn URL. ### Method POST ### Endpoint `/companyLiveEnrich` (via SDK client) ### Parameters #### Request Body - **client** (object) - Required - The initialized Fiber AI client. - **body** (object) - Required - The request payload. - **apiKey** (string) - Required - Your Fiber AI API key. - **domain** (string) - Optional - The company's domain name. - **linkedinUrl** (string) - Optional - The company's LinkedIn profile URL. ### Request Example ```typescript const company = await companyLiveEnrich({ client, body: { apiKey, domain: "example.com" /* or linkedinUrl */ }, }); ``` ### Response #### Success Response (200) - **data** (object) - Contains the enriched company information. ``` -------------------------------- ### Set Fiber AI API Key Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/cursor/commands/fiber-setup.md Instructs how to set the FIBER_API_KEY environment variable. Add this to your shell profile for persistence. ```bash export FIBER_API_KEY=sk_live_... ``` -------------------------------- ### Synchronous Company Search with Fiber AI SDK Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/sdk-py/references/examples.md Perform a synchronous company search using the Fiber AI SDK. Ensure the FIBER_API_KEY environment variable is set and consult the API documentation for available search parameters. ```python import os from fiberai import Client from fiberai.api.search.company_search import sync as company_search_sync from fiberai.models.company_search_body import CompanySearchBody client = Client(base_url="https://api.fiber.ai") result = company_search_sync( client=client, body=CompanySearchBody( api_key=os.environ["FIBER_API_KEY"], search_params={ # Check https://api.fiber.ai/docs/ for the current filter schema # Common filters: location, employee count, industry, tech stack, funding, etc. }, page_size=25, ), ) ``` -------------------------------- ### Cursor-based Pagination for Company Search (TypeScript) Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Implement cursor-based pagination to retrieve all company search results across multiple requests. ```typescript import { companySearch } from "@fiberai/sdk"; async function searchAllCompanies(searchParams: Record) { const allResults: unknown[] = []; let cursor: string | null = null; do { const response = await companySearch({ client, body: { apiKey, searchParams, pageSize: 25, ...(cursor ? { cursor } : {}) }, }); allResults.push(...(response.data as any).results); cursor = (response.data as any).cursor ?? null; } while (cursor); return allResults; } ``` -------------------------------- ### Check Account Credits (TypeScript) Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Asynchronously retrieves the organization's credit balance using the Fiber AI SDK. Requires an initialized client and an API key. ```typescript const credits = await getOrgCredits({ client, query: { apiKey } }); ``` -------------------------------- ### TypeScript SDK - Company Search Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Demonstrates how to perform a company search using the TypeScript SDK. The API key is included in the request body, and the operation supports cursor-based pagination. ```APIDOC ## Company Search (TypeScript SDK) ### Description Performs a search for companies using specified parameters. Supports cursor-based pagination for retrieving large datasets. ### Method POST ### Endpoint `/companySearch` (via SDK client) ### Parameters #### Request Body - **client** (object) - Required - The initialized Fiber AI client. - **body** (object) - Required - The request payload. - **apiKey** (string) - Required - Your Fiber AI API key. - **searchParams** (object) - Optional - Filters for the company search. Refer to API documentation for schema. - **pageSize** (number) - Optional - Number of results per page. Defaults to 25. - **cursor** (string) - Optional - Cursor for pagination. Used for subsequent requests. ### Request Example ```typescript const companies = await companySearch({ client, body: { apiKey, searchParams: { /* filters */ }, pageSize: 25, ...(cursor ? { cursor } : {}) }, }); ``` ### Response #### Success Response (200) - **data** (object) - Contains search results and pagination cursor. - **results** (array) - Array of company data. - **cursor** (string) - Cursor for the next page of results. ``` -------------------------------- ### Build Audience Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/audience/SKILL.md Initiates the process of building the audience based on the defined search parameters. This action incurs costs and requires user confirmation. ```APIDOC ## Build Audience ### Description Starts the asynchronous process of building the audience. This operation consumes credits based on the number of companies and profiles found. User confirmation is mandatory before execution. ### Method POST /v1/audiences/{audienceId}/build ### Endpoint /v1/audiences/{audienceId}/build ### Parameters #### Path Parameters - **audienceId** (string) - Required - The ID of the audience to build. #### Request Body - **apiKey** (string) - Required - The API key for authentication. ### Confirmation **This step charges credits. Always confirm with the user first.** ### Status Transition `DRAFT` → `BUILDING` → `NORMAL` (or `FAILED`) ``` -------------------------------- ### Client Initialization Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/sdk-py/references/client-setup.md Initialize the Fiber AI client. Use `Client` for unauthenticated requests or when passing an API key per-request. Use `AuthenticatedClient` for token-based authentication. ```APIDOC ## Client Initialization ```python import os from fiberai import Client # For unauthenticated or per-request API key usage client = Client(base_url="https://api.fiber.ai") # For token-based authentication (if applicable, though docs suggest per-request API key) # from fiberai import AuthenticatedClient # authenticated_client = AuthenticatedClient(base_url="https://api.fiber.ai", token="YOUR_TOKEN") ``` ``` -------------------------------- ### People Search with Python SDK (Sync) Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Execute a synchronous people search using the Python SDK. Ensure you import the correct sync function and the `PeopleSearchBody` model. ```python from fiberai.api.search.people_search import sync as people_search_sync from fiberai.models.people_search_body import PeopleSearchBody people = people_search_sync( client=client, body=PeopleSearchBody(api_key=api_key, search_params={}, page_size=25), ) ``` -------------------------------- ### V2 MCP Company Search Tool Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Invoke the `companySearch_tool` directly via the V2 MCP. Ensure your `FIBER_API_KEY` is set and use `searchParams` for filters. Pagination is handled by `cursor`. ```javascript # V2 MCP — direct tool invocation: companySearch_tool({ apiKey: process.env.FIBER_API_KEY, searchParams: { // Always fetch current schema: get_endpoint_details_full("companySearch") // Common filters: location, headcountRange, industries, techStack, fundingStage }, pageSize: 25, cursor: null }) ``` -------------------------------- ### Verify API Key with Core MCP Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/setup/SKILL.md Use this operation to verify if your FIBER_API_KEY is correctly set and functional by checking your credit balance. ```python call_operation("getOrgCredits", {"query": {"apiKey": "..."}}) ``` -------------------------------- ### Making API Calls Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/sdk-py/references/client-setup.md API functions are imported from `fiberai.api.{domain}.{operation}` and are not methods on the client object. They accept the client instance and necessary parameters. ```APIDOC ## Making API Calls ```python import os from fiberai.api.account.get_org_credits import sync as get_credits_sync # Example: Get organization credits # The api_key is passed as a keyword argument, which maps to the query string for GET requests. credits = get_credits_sync(client=client, api_key=os.environ["FIBER_API_KEY"]) ``` Each API operation module exports four function variants: - `sync(*, client, body)`: For simple synchronous calls, returns parsed response or `None`. - `sync_detailed(*, client, body)`: For synchronous calls where detailed response information (status code, headers) is needed. - `asyncio(*, client, body)`: For asynchronous calls, returns parsed response or `None`. - `asyncio_detailed(*, client, body)`: For asynchronous calls requiring full response details. ``` -------------------------------- ### Configure VS Code for Fiber AI MCP Servers Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/README.md Add this JSON configuration to your `.vscode/mcp.json` file to set up Fiber AI MCP servers for VS Code. ```json { "mcpServers": { "fiber-ai-v2": { "type": "http", "url": "https://mcp.fiber.ai/mcp/v2" }, "fiber-ai-core": { "type": "http", "url": "https://mcp.fiber.ai/mcp" } } } ``` -------------------------------- ### Call companyLiveEnrich via Core MCP Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/enrich/SKILL.md Use this to fetch live LinkedIn company data. Call get_endpoint_details_full first to see the schema. ```python call_operation("companyLiveEnrich", {"body": {...}}) ``` -------------------------------- ### Handle Unexpected API Status Codes (Python) Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Demonstrates error handling for API calls, specifically checking for `UnexpectedStatus` exceptions and providing user-friendly messages for common status codes like 401 (Unauthorized), 402 (Payment Required), and 429 (Rate Limit Exceeded). ```python try: result = company_search_sync(client=client, body=CompanySearchBody(api_key=api_key, search_params={}, page_size=5)) except UnexpectedStatus as e: if e.status_code == 401: print("Invalid API key. Check FIBER_API_KEY env var.") elif e.status_code == 402: print("Insufficient credits. Top up: https://www.fiber.ai/app/subscription") elif e.status_code == 429: print("Rate limit exceeded. Retry after a moment.") ``` -------------------------------- ### Check Account Credits with Fiber AI SDK Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/sdk-py/references/examples.md Retrieve your current account credits synchronously using the Fiber AI SDK. This operation requires your API key. ```python from fiberai.api.account.get_org_credits import sync as get_credits_sync credits = get_credits_sync( client=client, api_key=os.environ["FIBER_API_KEY"], ) print(f"Credits: {credits}") ``` -------------------------------- ### Core MCP Meta-tools and Call Pattern Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Overview of the Core MCP meta-tools for accessing all Fiber AI API endpoints. It's crucial to call `get_endpoint_details_full` before `call_operation` to ensure correct parameter usage. ```bash # Core MCP meta-tools: search_endpoints — find endpoints matching a keyword list_all_endpoints — list every available API operation get_endpoint_details_full — get full parameter schema for an operationId call_operation — execute any API operation with body/query/path params # Core call pattern: call_operation("companySearch", { "body": { "apiKey": "sk_live_...", "searchParams": { ... }, "pageSize": 25 } }) ``` -------------------------------- ### Create Audience for Bulk Workflow Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Creates a new audience for bulk prospecting. Save the returned audienceId for subsequent operations. The initial status is 'DRAFT'. ```json # Step 1 — Create audience (save returned audienceId): call_operation("createAudience", { "body": { "apiKey": "sk_live_...", "name": "Series A SaaS - SF" } }) # → { audienceId: "aud_abc123", status: "DRAFT" } ``` -------------------------------- ### Estimate Enrichment Cost (Free) Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Estimates the credit cost for enriching an audience. This is a free operation and should always be performed before triggering actual enrichment to inform the user. ```json # Step 5 — Estimate enrichment cost (FREE — always do this first): get_endpoint_details_full("estimateEnrichmentCost") call_operation("estimateEnrichmentCost", { "body": { "apiKey": "sk_live_...", /* enrichment type options, limits */ }, "path": { "audienceId": "aud_abc123" } }) # Show user: contact count, cost breakdown, total credits needed → get confirmation ``` -------------------------------- ### Synchronous People Search with Fiber AI SDK Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/sdk-py/references/examples.md Execute a synchronous people search using the Fiber AI SDK. The FIBER_API_KEY must be configured in the environment. Refer to the API documentation for detailed search parameter options. ```python from fiberai.api.search.people_search import sync as people_search_sync from fiberai.models.people_search_body import PeopleSearchBody result = people_search_sync( client=client, body=PeopleSearchBody( api_key=os.environ["FIBER_API_KEY"], search_params={ # Check https://api.fiber.ai/docs/ for the current filter schema # Common filters: job title, seniority, department, current company, location, etc. }, page_size=25, ), ) ``` -------------------------------- ### Core MCP Company Search with Schema Fetch Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Use the Core MCP to search for companies by first fetching the schema with `get_endpoint_details_full` and then calling the operation with `call_operation`. Filters should be derived from the fetched schema. ```javascript # Core MCP — always fetch schema first: get_endpoint_details_full("companySearch") // inspect required fields call_operation("companySearch", { "body": { "apiKey": "sk_live_...", "searchParams": { /* filters from schema */ }, "pageSize": 25, "cursor": null } }) ``` -------------------------------- ### Make Synchronous API Call Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/skills/sdk-py/references/client-setup.md Import and use the synchronous function to make an API call. The API key is passed as a keyword argument. ```python from fiberai.api.account.get_org_credits import sync as get_credits_sync # GET endpoint — api_key as a keyword argument (mapped to query string) credits = get_credits_sync(client=client, api_key=os.environ["FIBER_API_KEY"]) ``` -------------------------------- ### Create Audience with Fiber AI Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/cursor/commands/fiber-audience.md Initiates the creation of a new audience. Requires an API key and a name for the audience. Save the returned audience ID for subsequent operations. ```python call_operation("createAudience", {"body": {"apiKey": "...", "name": "..."}}) ``` -------------------------------- ### Build Audience with Fiber AI Source: https://github.com/fiber-ai/fiber-ai-plugin/blob/main/cursor/commands/fiber-audience.md Initiates the process of building an audience based on the set filters. This operation consumes credits and requires user confirmation before proceeding. ```python call_operation("buildAudience", ...) ``` -------------------------------- ### Core MCP People Search with Schema Fetch Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Search for people using the Core MCP by first retrieving the schema with `get_endpoint_details_full` and then executing the search with `call_operation`. Specify parameters like title, seniority, and company in `searchParams`. ```javascript # People search (same pattern): get_endpoint_details_full("peopleSearch") call_operation("peopleSearch", { "body": { "apiKey": "sk_live_...", "searchParams": { /* title, seniority, department, company, location */ }, "pageSize": 25 } }) ``` -------------------------------- ### Python SDK - People Search Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Demonstrates synchronous people search using the Python SDK. The `PeopleSearchBody` model is used for the request. ```APIDOC ## People Search (Python SDK - Sync) ### Description Performs a synchronous search for people using the Python SDK. The request body is defined by the `PeopleSearchBody` model. ### Method POST ### Endpoint `/search/people_search` (via SDK client) ### Parameters #### Request Body (`PeopleSearchBody` model) - **api_key** (str) - Required - Your Fiber AI API key. - **search_params** (dict) - Optional - Filters for the people search (e.g., title, seniority, department). - **page_size** (int) - Optional - Number of results per page. Defaults to 25. ### Request Example ```python from fiberai.api.search.people_search import sync as people_search_sync from fiberai.models.people_search_body import PeopleSearchBody people = people_search_sync( client=client, body=PeopleSearchBody(api_key=api_key, search_params={}, page_size=25), ) ``` ### Response #### Success Response (200) - **data** (dict) - Contains search results. ``` -------------------------------- ### TypeScript SDK - People Search Source: https://context7.com/fiber-ai/fiber-ai-plugin/llms.txt Shows how to search for people using the TypeScript SDK. Similar to company search, the API key is in the body. ```APIDOC ## People Search (TypeScript SDK) ### Description Searches for people based on provided criteria. The API key is included in the request body. ### Method POST ### Endpoint `/peopleSearch` (via SDK client) ### Parameters #### Request Body - **client** (object) - Required - The initialized Fiber AI client. - **body** (object) - Required - The request payload. - **apiKey** (string) - Required - Your Fiber AI API key. - **searchParams** (object) - Optional - Filters for the people search (e.g., title, seniority, department). - **pageSize** (number) - Optional - Number of results per page. Defaults to 25. ### Request Example ```typescript const people = await peopleSearch({ client, body: { apiKey, searchParams: { /* title, seniority, department */ }, pageSize: 25, }, }); ``` ### Response #### Success Response (200) - **data** (object) - Contains search results. ```