### Run LangGraph Agent Example Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/mcp-docs/implement-with-langgraph.mdx This function demonstrates how to initiate the LangGraph agent execution. It defines a configuration dictionary containing placeholder API keys and then calls the `run_explorium_agent` function to start the agent process. The `if __name__ == "__main__"` block ensures this example runs when the script is executed directly. ```python async def run_langgraph(): """Example usage of the Explorium LangGraph""" # Configuration with API keys config = { "configurable": { "explorium_api_key": "your-explorium-api-key", "anthropic_api_key": "your-anthropic-api-key" } } await run_explorium_agent(config) # Run the agent if __name__ == "__main__": asyncio.run(run_langgraph()) ``` -------------------------------- ### Quick Start: Initialize MCP Client and Load Tools Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/mcp-docs/implement-with-langgraph.mdx A minimal example to initialize the MultiServerMCPClient with Explorium's URL and API key, create a session, and load available MCP tools. Ensure you replace 'your-explorium-api-key' with your actual key. ```python import asyncio from langchain_mcp_adapters.client import MultiServerMCPClient from langchain_mcp_adapters.tools import load_mcp_tools async def quick_start(): # Initialize MCP client client = MultiServerMCPClient({ "explorium": { "transport": "streamable_http", "url": "https://mcp.explorium.ai/mcp", "headers": { "api_key": "your-explorium-api-key" } } }) # Create session and load tools async with client.session("explorium") as session: tools = await load_mcp_tools(session) print(f"Loaded {len(tools)} Explorium tools") for tool in tools[:5]: print(f" - {tool.name}") # Run the example asyncio.run(quick_start()) ``` -------------------------------- ### Basic Chatbot Query Example Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/integrations/n8n/explorium-prospects-search-chatbot.mdx Start a conversation with the chatbot by providing a specific search query. This example demonstrates a simple request for VPs of Sales. ```text "Find me VPs of Sales at software companies in the US" ``` -------------------------------- ### Example Request (cURL) Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/prospects/events/get_prospects_enrollments.mdx Use this cURL command to make a GET request to the API to retrieve prospect enrollments. Ensure you replace placeholders with your actual API key and partner ID. ```shell curl -X GET \ "https://api.explorium.ai/v1/prospects/events/enrollments" \ -H "API_KEY: your_api_key_here" \ -H "parnter_id: your_partner_id" ``` -------------------------------- ### New Product Launch Event Query Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/businesses/events/types/new-product-launch.mdx This example demonstrates how to query the New Product Launch event using the Explorium API. It specifies the event type, business IDs, and a start timestamp. Note that this event is only available for recent announcements within the last quarter. ```APIDOC ## POST /v1/businesses/events ### Description Queries for businesses that have announced a new product launch. This event is only available for recent announcements within the last quarter. ### Method POST ### Endpoint /v1/businesses/events ### Request Body - **event_types** (array[string]) - Required - List of event types to query. For this event, use `"new_product"`. - **business_ids** (array[string]) - Required - List of business IDs to filter the events by. - **timestamp_from** (datetime) - Required - The start of the time range for the events. For new product launches, this should be within the last quarter. ### Request Example ```json { "event_types": [ "new_product" ], "business_ids": [ "8adce3ca1cef0c986b22310e369a0793" ], "timestamp_from": "2025-01-01T10:03:03.050Z" } ``` ### Response #### Success Response (200) - **product_name** (string) - Name of the company's newly announced product. - **product_description** (string) - Details about the product. - **event_time** (datetime) - The timestamp indicating when the event actually occurred. - **snippet** (string) - Snippet of the published article or report on the company's new product. - **title** (string) - Title of the published news report or article on the company's new product. - **link** (url) - Link to the article announcing the company's new product. - **event_name** (string) - Name of the event related to the company's new product launch. ``` -------------------------------- ### Body Params - Try Me Example Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/businesses/match_businesses.mdx Provides example body parameters for matching businesses. Use this to test the business matching API. ```yaml name: Apple domain: apple.com name: Microsoft domain: microsoft.com ``` -------------------------------- ### Example Response Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/prospects/events/get_prospects_enrollments.mdx This is an example of the JSON response you will receive when successfully retrieving prospect enrollments. It includes response context and a list of active enrollment configurations. ```json { "response_context": { "correlation_id": "1234", "request_status": "success", "time_took_in_seconds": 0.515 }, "enrollments": [ { "enrollment_id": "en_8d52c3f1", "enrollment_key": "tech_executives_monitor", "prospect_ids": ["20ae6cbf564ee683e66685e429844a5ff8ffc30f", "4c485f009d59e319dc039cdf3e935b85014e6a33"], "event_types": ["prospect_changed_role", "prospect_changed_company"] }, { "enrollment_id": "en_7d31a9c2", "enrollment_key": "sales_prospects", "prospect_ids": ["fd4c46716295a2e4731417eee802a883280e4d57", "a7bbe0674c63338e62ae4c10751ae19da5723e5a"], "event_types": ["prospect_job_start_anniversary", "prospect_changed_company"] } ] } ``` -------------------------------- ### Basic Example: Find Companies Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/mcp-docs/implement-with-openai.mdx A complete example demonstrating how to find companies using specific criteria with AgentSource MCP and OpenAI. Replace API keys with your actual keys. ```python from openai import OpenAI # Initialize client client = OpenAI(api_key="your-openai-api-key") # Make a request to find banks response = client.responses.create( model="gpt-4.1", tools=[{ "type": "mcp", "require_approval": "never", "server_label": "explorium", "server_url": "https://mcp.explorium.ai/mcp", "headers": { "api_key": "YOUR_AGENTSOURCE_API_KEY" } }], input="Find 10 banks in the US with less than 5000 employees that use Azure" ) # The response will contain the results print(response) ``` -------------------------------- ### Install LangGraph, Langchain Anthropic, and MCP Adapters Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/mcp-docs/implement-with-langgraph.mdx Install the necessary Python packages for LangGraph, Anthropic LLM integration, and MCP adapters. For Databricks, use %pip install in separate cells and restart the kernel. ```bash pip install langgraph langchain_anthropic langchain_mcp_adapters ``` ```python %pip install langgraph %pip install langchain_anthropic %pip install langchain_mcp_adapters ``` ```python dbutils.library.restartPython() ``` -------------------------------- ### Example cURL Request Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/businesses/events/get_businesses_enrollments.mdx Use this cURL command to make a GET request to the API endpoint. Include your API key and partner ID in the headers for authentication and identification. ```shell curl -X GET \ "https://api.explorium.ai/v1/businesses/events/enrollments" \ -H "API_KEY: your_api_key_here" \ -H "partner_id: your_partner_id" ``` -------------------------------- ### Business ID Example Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/businesses/enrichments/business_challenges.mdx This is an example of a business ID that can be used as a parameter. ```text business_id: 8adce3ca1cef0c986b22310e369a0793 ``` -------------------------------- ### Prospect Fetch Response Example (JSON) Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/quick-starts/use_case_prospecting.mdx This is an example of the JSON response structure when fetching prospects. It includes pagination and a list of prospects with basic details like name and company. ```json { "total_results": 56, "data": [ { "prospect_id": "xyz123456789abc", "full_name": "Jane Marketing", "job_title": "Marketing Manager", "company_name": "Example Software Inc.", "emails": [ "[email protected]" ], ... }, ... ] } ``` -------------------------------- ### Fetch Prospects API Response Example Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/prospects/fetch_prospects.mdx This is an example of the JSON response when fetching prospects. It includes prospect details, pagination information, and total results. ```json { "prospects": [ { "prospect_id": "0a48b12d25abfc597d92a8a626697198202bc3bc", "professional_email_hashed": null, "first_name": "Nikitha", "last_name": "Lakshmanan", "full_name": "Nikitha Lakshmanan", "country_name": "united states", "region_name": null, "city": "san francisco bay area", "linkedin": "linkedin.com/in/ACoAAB_PD-QB8ChlFofVGx6sezeUUk32eAy7EBo", "experience": [ "Student research assistant", "usc shm lab", "Mobile application developer", "Senior software engineering manager", "Senior software engineer", "Software engineer", "Software engineering intern", "Staff software engineer" ], "skills": [ "Java", "C++", "C", "Microsoft office", "Programming", "Python", "Ios", "Swift", "Unix", "Sql", "Matlab", "Linux", "Start-up environment" ], "interests": null, "company_name": "Apple", "company_website": "apple.com", "company_linkedin": "linkedin.com/company/apple", "job_department": "Engineering", "job_department_array": [ "engineering" ], "job_department_main": "Engineering", "job_seniority_level": [ "manager" ], "job_level_array": [ "manager" ], "job_level_main": "manager", "job_title": "Senior software engineering manager", "business_id": "8adce3ca1cef0c986b22310e369a0793", "linkedin_url_array": [ "linkedin.com/in/ACoAAB_PD-QB8ChlFofVGx6sezeUUk32eAy7EBo", "linkedin.com/in/nikitha-lakshmanan" ] } ], "total_results": 10, "page": 1, "total_pages": 1 } ``` -------------------------------- ### Business Fetch Response Example (JSON) Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/quick-starts/use_case_prospecting.mdx This is an example of the JSON response structure when fetching business data. It includes pagination details and a list of businesses with basic information. ```json { "total_results": 12000, "page": 1, "total_pages": 120, "data": [ { "business_id": "8adce3ca1cef0c986b22310e369a0793", "name": "Example Software Inc.", "domain": "examplesoftware.com", "country_name": "united states", "number_of_employees_range": "11-50", ... }, ... ] } ``` -------------------------------- ### Example API Response Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/businesses/events/get_businesses_enrollments.mdx This is an example of a successful response from the Get Business Events Enrollments endpoint. It includes response context and a list of active enrollments, detailing their IDs, keys, associated business IDs, and event types. ```json { "response_context": { "correlation_id": "1234", "request_status": "success", "time_took_in_seconds": 0.515 }, "enrollments": [ { "enrollment_id": "en_7b429a01", "enrollment_key": "my_b2b_saas_monitor", "business_ids": ["8adce3ca1cef0c986b22310e369a0793", "665595bbb4e724de6f8bc705a5b84753"], "event_types": ["ipo_announcement", "new_funding_round", "new_product"] }, { "enrollment_id": "en_9c31b8d2", "enrollment_key": "fintech_competitors", "business_ids": ["2222", "3333"], "event_types": ["new_partnership", "new_investment"] } ] } ``` -------------------------------- ### Example Request - First Page Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/pagination.mdx Make a POST request to the businesses endpoint with `next_cursor` set to `null` to retrieve the first page of results. ```bash curl -X POST "https://api.explorium.ai/v1/businesses" \ -H "api_key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "filters": { "country_code": { "values": ["US"] }, "company_size": { "values": ["51-200"] } }, "mode": "full", "page_size": 100, "next_cursor": null }' ``` -------------------------------- ### Example Response for Get Active Credits Summary Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/credits/get_active_credits_summary.mdx This JSON object shows the structure of the response when retrieving your active credits summary. It includes details on allocated credits, remaining credits, and response context. ```json { "response_context": { "correlation_id": "5618d686ecb849fda660c3023acf3120", "request_status": "success", "time_took_in_seconds": 0.074 }, "allocated_credits": 1000, "remaining_credits": 964 } ``` -------------------------------- ### Multi-turn Conversation: Initial Query Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/mcp-docs/implement-with-openai.mdx Initiate a multi-turn conversation by making an initial query to find VPs at a company. This sets up the context for subsequent follow-up questions. ```python # Initial query response1 = client.responses.create( model="gpt-4.1", tools=[{ "type": "mcp", "require_approval": "never", "server_label": "explorium", "server_url": "https://mcp.explorium.ai/mcp", "headers": { "api_key": "YOUR_AGENTSOURCE_API_KEY" } }], input="Find all VPs at Tesla" ) ``` -------------------------------- ### Install MCP Python SDK Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/mcp-docs/python-sdk-implementation-guide.mdx Install the MCP Python SDK using pip. You may need to restart your Python kernel after installation, especially in environments like Jupyter or Databricks. ```shell pip install mcp ``` ```python # For Jupyter/Databricks dbubbles.library.restartPython() ``` -------------------------------- ### Install OpenAI Package Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/mcp-docs/implement-with-openai.mdx Install the necessary OpenAI Python package using pip. ```shell pip install openai ``` -------------------------------- ### Full cURL Request Example Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/businesses/fetch_businesses.mdx A comprehensive cURL command demonstrating how to fetch businesses with pagination, filtering, and exclusion parameters. ```shell curl -X POST \ "https://api.explorium.ai/v1/businesses" \ -H "API_KEY: your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "mode": "full", "size": 10000, "page_size": 100, "page": 1, "exclude": ["00000230f8f8d86e167e189c7c3b4bd6"], "filters": { "country_code": { "values": ["us"] }, "company_size": { "values": ["11-50", "51-200"] } }, "request_context": {} }' ``` -------------------------------- ### Initialize OpenAI Client Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/mcp-docs/implement-with-openai.mdx Initialize the OpenAI client with your API key. Ensure you replace 'your-openai-api-key' with your actual key. ```python from openai import OpenAI # Initialize the client with your OpenAI API key client = OpenAI(api_key="your-openai-api-key") ``` -------------------------------- ### Prospect Statistics Request Example Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/prospects/prospects_stats.mdx An example JSON request body for fetching prospect statistics with multiple filters applied. ```json { "filters": { "job_department": { "values": ["engineering", "sales", "marketing"] }, "region_country_code": { "values": ["us-ca", "us-ny", "us-tx"] }, "company_size": { "values": ["51-200", "201-500"] } } } ``` -------------------------------- ### Tool Chaining Example Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/integrations/claude/claude-desktop-integration.mdx Demonstrates how Claude can automatically chain multiple tools to fulfill a complex request. This is useful for multi-step analysis or data retrieval. ```text "Find the top 5 competitors of Salesforce and compare their employee counts and technologies" This triggers: 1. match_businesses (Salesforce) 2. enrich_businesses_competitive_landscape 3. match_businesses (for each competitor) 4. enrich_businesses_firmographics 5. enrich_businesses_technographics ``` -------------------------------- ### Example Response - First Page Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/pagination.mdx The response includes `data`, `total_results`, and `page` information. The `page.next_cursor` is used to fetch subsequent pages. ```json { "response_context": { "correlation_id": "def456", "request_status": "success", "time_took_in_seconds": 0.38 }, "data": [ ... ], "total_results": 12350, "page": { "size": 100, "next_cursor": "eyJzZWFyY2hfYWZ0ZXIiOiBbMTcwOTEyMzQ1Nl19" } } ``` -------------------------------- ### Example Request Body with Filters Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/businesses/fetch_businesses.mdx Illustrates how to specify filters for company size in the request body. ```json { "filters": { "company_size": { "values": ["11-50", "51-200"] } } } ``` -------------------------------- ### Request Body Example Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/credits/get_credit_consumption_aggregation.mdx This is an example of a request body for the credit consumption aggregation endpoint. It specifies the date range, resolution, and timezone for the aggregation. ```json { "from_date": "2025-08-23T00:00:00Z", "to_date": "2025-08-24T00:00:00Z", "resolution": "hour", "timezone": "America/New_York", "key_name": "production-key" } ``` -------------------------------- ### Businesses Autocomplete - Body Params Example Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/businesses/autocomplete/businesses_autocomplete.mdx Example of body parameters for the Businesses Autocomplete API. Use this to specify search fields and queries. ```text field: country query: unit ``` -------------------------------- ### Query New Office Opening Events Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/businesses/events/types/new-office-opening.mdx This example demonstrates how to query for new office opening events using the Explorium API. It specifies the event type and provides a timestamp for recent expansions. ```APIDOC ## POST /v1/businesses/events ### Description Retrieves information about new office opening events for businesses. ### Method POST ### Endpoint /v1/businesses/events ### Parameters #### Request Body - **event_types** (array of strings) - Required - The type of event to query, use `"new_office"` for this event. - **business_ids** (array of strings) - Required - A list of business IDs to retrieve events for. - **timestamp_from** (string) - Required - The start of the time range for the events. For new office openings, this should be set to the past 3 months. ### Request Example ```json { "event_types": [ "new_office" ], "business_ids": [ "8adce3ca1cef0c986b22310e369a0793" ], "timestamp_from": "2025-01-01T10:03:03.050Z" } ``` ### Response #### Success Response (200) - **event_time** (datetime) - The timestamp indicating when the event actually occurred. - **purpose_of_new_office** (string) - Short description of the new office's purpose, extracted from the article. - **link** (url) - Link to article announcing the company's new office. - **office_location** (string) - Text extracted from the article indicating where the new office is located. - **number_of_employees** (integer) - Number of employees working from the new office's location. - **title** (string) - Title of published news report or article on company's new office. - **snippet** (string) - Short excerpt or highlight text summarizing the award or announcement. - **event_name** (string) - Name of the event related to company's new office. #### Response Example ```json { "events": [ { "event_time": "2024-03-15T09:00:00Z", "purpose_of_new_office": "Engineering Hub", "link": "https://example.com/news/company-opens-new-sf-office", "office_location": "San Francisco, CA", "number_of_employees": 150, "title": "TechCorp Expands to San Francisco with New Engineering Hub", "snippet": "TechCorp announced the opening of its new San Francisco office, focusing on AI research and development.", "event_name": "new_office" } ] } ``` ``` -------------------------------- ### Match Businesses using MCP SDK Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/mcp-docs/python-sdk-implementation-guide.mdx Use the `match_businesses` tool to find business IDs by name or domain. This example demonstrates preparing input data, calling the tool, and processing the results to extract matched business information. ```python async def match_businesses_example(): api_key = os.environ.get('EXPLORIUM_API_KEY', 'your-api-key') headers = {"Authorization": f"Bearer {api_key}"} async with sse_client( url="https://mcp.explorium.ai/sse", headers=headers ) as streams: read_stream, write_stream = streams async with ClientSession(read_stream, write_stream) as session: await session.initialize() # Prepare businesses to match match_input = { "businesses_to_match": [ {"name": "Google"}, {"domain": "microsoft.com"}, {"name": "Amazon", "domain": "amazon.com"} ] } # Call the match_businesses tool result = await session.call_tool("match_businesses", arguments=match_input) # Process results if hasattr(result, 'content') and result.content: data = json.loads(result.content[0].text) print(f"Matched {data['total_matches']} businesses:") for business in data['matched_businesses']: print(f" • {business['input']} ID: {business['business_id']}") asyncio.run(match_businesses_example()) ``` -------------------------------- ### Refined Chatbot Query Example Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/integrations/n8n/explorium-prospects-search-chatbot.mdx Refine your search by adding more criteria to the existing conversation. This example adds 'directors' and filters by company size. ```text "Can you also include directors and filter for companies with 100+ employees?" ``` -------------------------------- ### Example Support Request Structure Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/support-help-center.mdx This JSON structure outlines the information to include when submitting a support request, detailing the issue, steps taken, and expected/actual responses. ```json { "issue": "Received a 403 error when calling the Fetch Business Events API", "steps_to_replicate": "Sent a request to \`/businesses/events\` with valid parameters", "exact_request_send": "", "expected_response": "A list of recent business events", "actual_response": { "error": "You have insufficient credits to perform this operation." }, "correlation_id": "4826416550f648e58cc9e2ceee2529b7" } ``` -------------------------------- ### Test API Key with Python Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/setup/getting_your_api_key.mdx This Python script demonstrates how to set up the necessary headers and payload for a request to the /v1/prospects endpoint using your API key. ```python import requests url = "https://api.explorium.ai/v1/prospects" payload = { "mode": "full", "page": 1 } headers = { "accept": "application/json", "content-type": "application/json", "api_key": "YOUR_API_KEY" } ``` -------------------------------- ### Rate Limit Response Example Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/rate-limit.mdx This is an example of a 429 Too Many Requests response, including headers and a JSON body indicating the rate limit has been exceeded. ```bash HTTP/1.1 429 Too Many Requests Retry-After: 60 X-RateLimit-Limit: 200 X-RateLimit-Remaining: 0 X-RateLimit-Reset: 1234567890 Content-Type: application/json { "error": "rate_limit_exceeded", "message": "API rate limit exceeded. Please retry after 60 seconds.", "retry_after": 60 } ``` -------------------------------- ### Manage Connections with Context Managers in Python Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/mcp-docs/python-sdk-implementation-guide.mdx Illustrates using asynchronous context managers (`async with`) for the `sse_client` and `ClientSession` to ensure proper connection handling and automatic cleanup. ```python async with sse_client(url, headers) as streams: async with ClientSession(*streams) as session: # Your operations here pass # Connection automatically closed ``` -------------------------------- ### Example Prospecting Request (cURL) Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/prospects/fetch_prospects.mdx Example cURL request to fetch prospects with specific filters for job level and department, and presence of email and phone number. ```curl { "request_context": {}, "mode": "full", "size": 10, "page_size": 10, "page": 1, "exclude": [ "a5fbfab4d7221b144efecbe83e55cbf80b64bd50" ], "filters": { "has_email": { "value": true }, "has_phone_number": { "value": true }, "job_level": { "values": [ "owner", "cxo", "vp", "director", "senior", "manager", "partner", "non-managerial", "founder", "training", "c-suite" ] }, "job_department": { "values": [ "real estate", "Customer service", "Trades", "design", ``` -------------------------------- ### Example Request - Next Page Source: https://github.com/explorium-ai/explorium-mintlify-docs/blob/main/reference/pagination.mdx To retrieve the next page, pass the `next_cursor` obtained from the previous response in the request payload. ```bash curl -X POST "https://api.explorium.ai/v1/businesses" \ -H "api_key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "filters": { "country_code": { "values": ["US"] }, "company_size": { "values": ["51-200"] } }, "mode": "full", "page_size": 100, "next_cursor": "eyJzZWFyY2hfYWZ0ZXIiOiBbMTcwOTEyMzQ1Nl19" }' ```