### Setup SixtyFour API Key and Endpoint Configuration (Python) Source: https://docs.sixtyfour.ai/starter-notebooks/sixtyfour-qa-agent-tutorial This Python code snippet sets up the necessary parameters for interacting with the SixtyFour API. It retrieves the API key from environment variables or Google Colab secrets, defines the base URL and endpoint for the qa-agent, and sets a timeout. It also includes example data parameters that can be modified by the user. ```python # --- Parameters (you can change these) --- DATA_NAME = "Saarth Shah" DATA_BUSINESS_TYPE = "Bakery" DATA_FOLLOWERS = "1 million" DATA_TWITTER = "saarth_" DATA_POSTS = "6500" import os, json, requests API_KEY = os.getenv("SIXTYFOUR_API_KEY", "") try: from google.colab import userdata secret_val = userdata.get("SIXTYFOUR_API_KEY") if secret_val: os.environ["SIXTYFOUR_API_KEY"] = secret_val API_KEY = secret_val except Exception: pass BASE_URL = "https://api.sixtyfour.ai" ENDPOINT = f"{BASE_URL}/qa-agent" TIMEOUT_S = 600 print("✅ Setup complete (key detected, endpoint ready).") ``` -------------------------------- ### Define Example Qualification Criteria and Structs (Python) Source: https://docs.sixtyfour.ai/starter-notebooks/sixtyfour-qa-agent-tutorial This code provides pre-defined examples for 'qualification_criteria' and 'struct' configurations. These examples illustrate how to set up different levels of strictness for criteria (light vs. strict) and how to define minimal output structures for the AI's response. ```python example_criteria_light = [ {"criteria_name": "Active Posting", "description": "Posts at least weekly", "weight": 5.0}, {"criteria_name": "Audience Size", "description": "At least 1000 followers", "weight": 3.0} ] example_criteria_strict = [ {"criteria_name": "Inventory Ownership", "description": "Owns and ships products directly", "weight": 10.0, "threshold": 9.0}, {"criteria_name": "EU Location", "description": "Located in EU", "weight": 6.0} ] example_struct_min = { "suitability_score": "Overall score (0-10)", "final_verdict": "YES/NO decision" } print("Ready-to-use examples:") print("criteria (light):", example_criteria_light) print("criteria (strict):", example_criteria_strict) print("struct (minimal):", example_struct_min) ``` -------------------------------- ### Python Example: Async Lead Enrichment Source: https://docs.sixtyfour.ai/api-reference/endpoint/enrich-lead This Python script demonstrates how to use the Sixtyfour AI API to start an asynchronous lead enrichment job and poll for its results. It includes setting up the request, handling the task ID, and checking the status in a loop. ```python import requests import time # Start async job response = requests.post( 'https://api.sixtyfour.ai/enrich-lead-async', headers={ 'x-api-key': 'your_api_key', 'Content-Type': 'application/json' }, json={ "lead_info": { "name": "Saarth Shah", "title": "CEO & Co-Founder @ Sixtyfour AI", "company": "Sixtyfour AI", "location": "San Francisco", "linkedin": "https://www.linkedin.com/in/saarthshah" }, "struct": { "name": "The individual's full name", "email": "The individual's email address", "phone": "The individual's phone number", "company": "The company the individual is associated with", "title": "The individual's job title", "linkedin": "LinkedIn URL for the person", "website": "Company website URL", "location": "The individual's location and/or company location", "industry": "Industry the person operates in" } } ) task_info = response.json() task_id = task_info['task_id'] # Poll for results while True: status_response = requests.get( f'https://api.sixtyfour.ai/job-status/{task_id}', headers={'x-api-key': 'your_api_key'} ) status_data = status_response.json() if status_data['status'] == 'completed': results = status_data['result'] break elif status_data['status'] == 'failed': print(f"Job failed: {status_data.get('error', 'Unknown error')}") break time.sleep(10) # Wait 10 seconds before checking again ``` -------------------------------- ### Python Example Usage for QA Agent API Source: https://docs.sixtyfour.ai/api-reference/endpoint/qa-agent A Python example demonstrating how to use the 'requests' library to send a POST request to the QA Agent API. It includes setting headers and constructing the JSON request body. ```python import requests response = requests.post( 'https://api.sixtyfour.ai/qa-agent', headers={ 'x-api-key': 'your_api_key', 'Content-Type': 'application/json' }, json={ "data": { "name": "Alex Johnson", "country": "United Kingdom", "business_type": "e-commerce seller", "follower_count": "2500" }, "qualification_criteria": [ { "criteria_name": "Physical Inventory", "description": "Must own and store physical products", "weight": 10.0, "threshold": 8.0 } ], "struct": { "suitability_score": "Overall score (0-10)", "final_verdict": "YES/NO decision" } } ) results = response.json() ``` -------------------------------- ### Synchronous Company Enrichment Example Source: https://docs.sixtyfour.ai/api-reference/endpoint/enrich-company Provides an example of how to synchronously enrich company data using the API. ```APIDOC ## POST /enrich-company (Synchronous Example) ### Description An example demonstrating synchronous company data enrichment. Note: For large or complex enrichments, the asynchronous endpoint is recommended. ### Method POST ### Endpoint https://api.sixtyfour.ai/enrich-company ### Parameters #### Headers - **x-api-key** (string) - Required - Your API key. - **Content-Type** (string) - Required - Must be `application/json`. #### Request Body - **target_company** (object) - Required - Information about the company to enrich. - **company_name** (string) - Required - The name of the company. - **address** (string) - Optional - The address of the company. - **phone_number** (string) - Optional - The phone number of the company. - **website** (string) - Optional - The website of the company. - **struct** (object) - Required - Defines the structure and desired output fields. - **field_name** (string or object) - Required - The name of the field to retrieve. Can be a string for simple descriptions or an object for type definitions. - **description** (string) - Optional - A description of the field. - **type** (string) - Optional - The desired data type for the field (e.g., "str", "int", "bool", "list"). - **find_people** (boolean) - Optional - Whether to find people associated with the company. - **people_focus_prompt** (string) - Optional - A prompt to guide the search for people. ### Request Example ```json { "target_company": { "company_name": "Pacific View Studios", "address": "1234 Ocean View Dr, La Jolla, CA 92037", "phone_number": "+16195551234", "website": "https://pacificview.studio" }, "struct": { "instagram_url": "Instagram url for the photography company", "num_employees": "How many employees work there" }, "find_people": true, "people_focus_prompt": "Find me the owners of the company" } ``` ### Response #### Success Response (200) - **results** (object) - The enriched company data. #### Response Example ```json { "results": { "company_name": "Pacific View Studios", "website": "https://pacificview.studio", "instagram_url": "https://www.instagram.com/pacificviewstudios/", "num_employees": 50 } } ``` ``` -------------------------------- ### Start Async Job POST Request Example Source: https://docs.sixtyfour.ai/api-reference/endpoint/enrich-company This HTTP POST request is used to initiate an asynchronous company data enrichment job. The endpoint is `https://api.sixtyfour.ai/enrich-company-async`. The request body format is identical to the synchronous endpoint. ```http POST https://api.sixtyfour.ai/enrich-company-async ``` -------------------------------- ### Start Async Job Request Source: https://docs.sixtyfour.ai/api-reference/endpoint/enrich-lead This HTTP POST request initiates an asynchronous enrichment job. The request body should mirror the synchronous endpoint's format. ```http POST https://api.sixtyfour.ai/enrich-lead-async ``` -------------------------------- ### Initialize SixtyFour API Client and Setup Source: https://docs.sixtyfour.ai/starter-notebooks/sixtyfour-enrich-lead-tutorial Sets up the Python environment for interacting with the SixtyFour API. It retrieves the API key from environment variables or Google Colab secrets and defines API endpoints and timeouts. Ensures the API key is available. ```python import os, json, time, csv, io from datetime import datetime from typing import Dict, Any, List, Optional import requests import pandas as pd API_KEY = os.getenv("SIXTYFOUR_API_KEY", "") # fallback if already set locally try: from google.colab import userdata secret_val = userdata.get("SIXTYFOUR_API_KEY") # raises if not granted or not created if secret_val: # avoid overwriting with empty os.environ["SIXTYFOUR_API_KEY"] = secret_val API_KEY = secret_val except Exception: # Not in Colab or secret not available; rely on existing env var pass BASE_URL = "https://api.sixtyfour.ai" SYNC_ENDPOINT = f"{BASE_URL}/enrich-lead" ASYNC_ENDPOINT = f"{BASE_URL}/enrich-lead-async" STATUS_ENDPOINT = f"{BASE_URL}/job-status" TIMEOUT_S = 600 # We reuse these endpoints and TIMEOUT_S throughout the notebook. print("✅ Setup complete (key detected, endpoints ready).") ``` -------------------------------- ### Start Async Job Source: https://docs.sixtyfour.ai/api-reference/endpoint/enrich-lead Submit a lead enrichment job asynchronously. This endpoint returns a task ID that can be used to monitor the job's progress and retrieve results later. ```APIDOC ## POST /enrich-lead-async ### Description Submits a lead enrichment job asynchronously. Returns a task ID for status checking and result retrieval. ### Method POST ### Endpoint https://api.sixtyfour.ai/enrich-lead-async ### Request Body - **lead_info** (object) - Required - Information about the lead to enrich. - **name** (string) - Required - The individual's full name. - **title** (string) - Optional - The individual's job title. - **company** (string) - Optional - The company the individual is associated with. - **location** (string) - Optional - The individual's location. - **linkedin** (string) - Optional - LinkedIn URL for the person. - **struct** (object) - Required - Defines the desired structure and types for the output. - **field_name** (string) - Required - Description of the field. ### Request Example ```json { "lead_info": { "name": "Saarth Shah", "title": "CEO & Co-Founder @ Sixtyfour AI", "company": "Sixtyfour AI", "location": "San Francisco", "linkedin": "https://www.linkedin.com/in/saarthshah" }, "struct": { "name": "The individual's full name", "email": "The individual's email address", "phone": "The individual's phone number", "company": "The company the individual is associated with", "title": "The individual's job title", "linkedin": "LinkedIn URL for the person", "website": "Company website URL", "location": "The individual's location and/or company location", "industry": "Industry the person operates in" } } ``` ### Response #### Success Response (200) - **task_id** (string) - The unique identifier for the asynchronous task. - **status** (string) - The initial status of the job (e.g., 'pending'). #### Response Example ```json { "task_id": "bdd69815-a1c0-480d-bfa5-d5fbb9745893", "status": "pending" } ``` #### Error Response (400) - **error** (string) - Indicates a bad request. - **message** (string) - Provides details about the error. #### Error Response Example ```json { "error": "Bad Request", "message": "Invalid lead information" } ``` ``` -------------------------------- ### Example Sales Prospecting Struct (Python) Source: https://docs.sixtyfour.ai/starter-notebooks/sixtyfour-enrich-company-tutorial An example Python dictionary defining a 'struct' for sales prospecting at the company level. It includes fields such as company name, website, employee count, headquarters location, industry, recent news, and key buyer functions, specifying their data types. ```python # Sales prospecting (company-level) example_sales_struct = { "company_name": "Official company name", "website": "Website URL", "num_employees": {"description": "Approximate employee count", "type": "int"}, "hq_location": {"description": "Headquarters (city, region, country)", "type": "string"}, "industry": {"description": "Primary industry/sector", "type": "string"}, "recent_news": {"description": "Recent press or announcements", "type": "list[string]"}, "key_buyers": {"description": "Buyer functions to target (e.g., Ops, RevOps)", "type": "list[string]"} } ``` -------------------------------- ### Example Product/Engineering Struct (Python) Source: https://docs.sixtyfour.ai/starter-notebooks/sixtyfour-enrich-company-tutorial An example Python dictionary defining a 'struct' for extracting product and engineering-related information about a company. It includes fields like company name, domain, tech stack, engineering team size, GitHub organization, and notable repositories, specifying their types. ```python # Product/Engineering mapping example_tech_struct = { "company_name": "Official company name", "domain": {"description": "Primary domain (e.g., example.com)", "type": "string"}, "tech_stack": {"description": "Key technologies used", "type": "list[string]"}, "engineering_team_size": {"description": "Approximate size of engineering org", "type": "int"}, "github_org": {"description": "Company GitHub org URL", "type": "string"}, "notable_repos": {"description": "Top repositories (names/links)", "type": "list[string]"} } ``` -------------------------------- ### QA Agent API Request Body Example Source: https://docs.sixtyfour.ai/api-reference/endpoint/qa-agent An example of the JSON request body for the QA Agent API. It includes the data to be evaluated, qualification criteria, optional references for research, and a struct to define the output format. ```json { "data": { "name": "Alex Johnson", "country": "United Kingdom", "business_type": "e-commerce seller", "follower_count": "2500", "post_count": "45", "instagram_handle": "alexshop_uk" }, "qualification_criteria": [ { "criteria_name": "Physical Inventory", "description": "Must own and store physical products for sales", "weight": 10.0, "threshold": 8.0 }, { "criteria_name": "Target Market Location", "description": "Must be located in UK, Germany, France, or Austria", "weight": 8.0 } ], "references": [ { "url": "https://www.instagram.com/alexshop_uk", "description": "Instagram business profile" } ], "struct": { "suitability_score": "Overall qualification score (0-10)", "disqualification_reason": "Primary reason for disqualification if applicable", "final_verdict": "Clear YES/NO decision", "recommendation": "ACCEPT/REJECT with reasoning" } } ``` -------------------------------- ### JSON Example for Type Inference from Values in Struct (JSON) Source: https://docs.sixtyfour.ai/api-reference/endpoint/enrich-company Shows how the API can infer data types based on the example values provided within the 'struct' definition in a JSON payload. This example demonstrates inference for float ('rating'), boolean ('is_remote'), and integer ('founded_year') types. ```json { "struct": { "rating": 4.5, // Inferred as float "is_remote": false, // Inferred as bool "founded_year": 2020 // Inferred as int } } ``` -------------------------------- ### Example Marketing Struct (Python) Source: https://docs.sixtyfour.ai/starter-notebooks/sixtyfour-enrich-company-tutorial An example Python dictionary defining a 'struct' for marketing analysis. It includes fields like brand social media handles, content topics, audience size estimate, newsletter or blog URL, and paid marketing channels used, specifying their data types. ```python # Marketing example_marketing_struct = { "brand_handles": {"description": "Social profiles (Twitter, Instagram, LinkedIn)", "type": "list[string]"}, "content_topics": {"description": "Topics they post about", "type": "list[string]"}, "audience_size": {"description": "Aggregate audience size estimate", "type": "int"}, "newsletter_url": {"description": "Newsletter or blog URL", "type": "string"}, "paid_channels": {"description": "Paid marketing channels used", "type": "list[string]"} } ``` -------------------------------- ### Quick cURL Example to Find Email Address Source: https://docs.sixtyfour.ai/api-reference/introduction This cURL command demonstrates how to make a POST request to the Sixtyfour API to find an email address for a lead. It includes the necessary API key, content type, and a JSON payload with lead information. ```curl curl -X POST 'https://api.sixtyfour.ai/find-email' \ -H 'x-api-key: YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "lead": { "name": "Saarth Shah", "company": "Sixtyfour.ai" } }' ``` -------------------------------- ### QA Agent API Success Response Example (200) Source: https://docs.sixtyfour.ai/api-reference/endpoint/qa-agent An example of a successful JSON response from the QA Agent API. It contains the structured evaluation results and detailed analysis notes based on the provided criteria and data. ```json { "structured_data": { "suitability_score": "9", "disqualification_reason": "", "final_verdict": "YES", "recommendation": "ACCEPT - Strong inventory-based business in target market" }, "notes": "Research of Alex Johnson, a UK-based e-commerce seller with 2500 Instagram followers, confirms operation of physical inventory business. Located in target market (United Kingdom). Instagram profile shows consistent product posts indicating active sales operations. Business model aligns well with qualification criteria." } ``` -------------------------------- ### Python Example with Error Handling for Find Phone API Source: https://docs.sixtyfour.ai/api-reference/endpoint/find-phone This Python example demonstrates robust error handling when calling the Find Phone API. It includes a try-except block to catch potential request exceptions and checks the response status before processing the JSON data. ```python try: response = requests.post(url, headers=headers, json=data) response.raise_for_status() # Raise an exception for bad status codes result = response.json() phone = result.get('phone', '') if phone: print(f"Phone found: {phone}") else: print("No phone number found") except requests.exceptions.RequestException as e: print(f"API request failed: {e}") ``` -------------------------------- ### QA Agent API Error Response Example (400) Source: https://docs.sixtyfour.ai/api-reference/endpoint/qa-agent An example of an error response (400 Bad Request) from the QA Agent API, indicating a problem with the request, such as a missing required field. ```json { "error": "Bad Request", "message": "Missing required field: qualification_criteria" } ``` -------------------------------- ### Python Example for Async Job Usage Source: https://docs.sixtyfour.ai/api-reference/endpoint/enrich-company This Python code snippet demonstrates how to interact with the asynchronous API endpoints. It shows the import of the `requests` library and the `time` module, which would typically be used for making HTTP requests and handling delays when polling for job status. ```python import requests import time ``` -------------------------------- ### Supported Data Types Source: https://docs.sixtyfour.ai/api-reference/endpoint/enrich-lead Lists the data types supported by the API, including their string representations and example values. ```APIDOC ## Supported Types ### Description This section details the data types that can be specified or inferred by the API. ### Type Definitions | Type | Example Values | | ----------------------- | -------------------- | | `"str"` or `"string"` | `"John Doe"` | | `"int"` or `"integer"` | `30`, `1000` | | `"float"` | `95.5`, `3.14` | | `"bool"` or `"boolean"` | `true`, `false` | | `"list"` | `["item1", "item2"]` | | `"list[str]"` | `["item1", "item2"]` | | `"list[int]"` | `[1, 2, 3]` | | `"list[float]"` | `[1.5, 2.7, 3.14]` | | `"dict"` | `{"key": "value"}` | ``` -------------------------------- ### Async Job Initiation Response Source: https://docs.sixtyfour.ai/api-reference/endpoint/enrich-lead Upon starting an asynchronous job, the API returns a JSON object containing a unique task ID and the initial status, which is typically 'pending'. ```json { "task_id": "bdd69815-a1c0-480d-bfa5-d5fbb9745893", "status": "pending" } ``` -------------------------------- ### Example Success Response for Lead Enrichment Source: https://docs.sixtyfour.ai/api-reference/endpoint/enrich-lead This snippet shows a typical successful response (200 OK) from the /enrich-lead endpoint. It contains the enriched 'structured_data' for the lead, 'notes' providing context, 'references' to the sources used, and a 'confidence_score' indicating the quality of the data. ```json { "notes": "Saarth Shah is the Co-Founder and CEO of Sixtyfour AI, an AI company focused on building AI agents to help GTM (Go-To-Market) teams sell better and faster to SMBs. He is based in San Francisco, California. His LinkedIn profile is https://www.linkedin.com/in/saarthshah, which shows 500+ connections and highlights his education with Y Combinator and UC Berkeley...", "structured_data": { "name": "Saarth Shah", "email": "saarth@sixtyfour.ai", "phone": "", "company": "Sixtyfour AI", "title": "CEO & Co-Founder", "linkedin": "https://www.linkedin.com/in/saarthshah", "website": "https://www.sixtyfour.ai/", "location": "San Francisco, California, USA", "industry": "Artificial Intelligence and Sales Technology", "github_url": "https://github.com/SaarthShah", "github_notes": "Saarth Shah's GitHub profile demonstrates technical expertise with projects related to AI and full-stack development. Notable repositories include search spelling correction, AI chatbots, and data science models, corroborating his data science background." }, "findings": [], "references": { "https://www.linkedin.com/in/saarthshah": "Saarth Shah LinkedIn profile with current role, location, and background information.", "https://www.sixtyfour.ai/": "Sixtyfour AI official company website detailing services and confirming company location and focus area.", "https://github.com/SaarthShah": "GitHub profile showing Saarth Shah's repositories and technical projects related to AI and full-stack development.", "https://www.saarthshah.com/": "Personal website of Saarth Shah with bio, projects, and contact email saarth@sixtyfour.ai." }, "confidence_score": 9.5 } ``` -------------------------------- ### cURL Example for Find Phone API Source: https://docs.sixtyfour.ai/api-reference/endpoint/find-phone This cURL command demonstrates how to call the Find Phone API. It includes the POST request to the endpoint, sets the Content-Type and API key headers, and provides the lead data in the request body. ```bash curl -X POST "https://api.sixtyfour.ai/find-phone" \ -H "Content-Type: application/json" \ -H "x-api-key: YOUR_API_KEY" \ -d '{ "lead": { "name": "Sarah Johnson", "company": "TechCorp Inc", "linkedin_url": "https://linkedin.com/in/sarahjohnson" } }' ``` -------------------------------- ### Enrich Lead Request using cURL Source: https://docs.sixtyfour.ai/ This snippet demonstrates how to enrich a lead using the Sixtyfour API via a cURL command. It requires an API key and specifies the endpoint and request method. The example shows setting the API key in the headers and the endpoint URL. ```shellscript curl -X POST \"https://api.sixtyfour.ai/enrich-lead\" \ -H \"x-api-key: YOUR_API_KEY\" \ -H \"Content-Type: application/json\" \ -d '{\n \"email\": \"test@example.com\",\n \"company_name\": \"Example Corp\"\n}' ``` -------------------------------- ### Polling Job Status Source: https://docs.sixtyfour.ai/api-reference/webhooks This example shows the fallback method of polling the job status endpoint. Use this if webhooks are not supported or if webhook delivery fails. You can retrieve the job status and results by sending a GET request to `/job-status/{task_id}`. ```bash GET /job-status/{task_id} ``` -------------------------------- ### Setup SixtyFour API Key and Endpoint Source: https://docs.sixtyfour.ai/starter-notebooks/sixtyfour-find-phone-tutorial This Python snippet sets up the necessary environment variables and configurations for interacting with the SixtyFour API. It retrieves the API key from environment variables or Google Colab secrets and defines the base URL and endpoint for the `find-phone` service. It includes error handling for secret retrieval. ```python # --- Parameters (you can change these) --- LEAD_NAME = "Saarth Shah" LEAD_COMPANY = "Sixtyfour AI" # LEAD_LINKEDIN = "https://linkedin.com/in/sarahjohnson" # LEAD_DOMAIN = None # LEAD_EMAIL = None import os, json, requests API_KEY = os.getenv("SIXTYFOUR_API_KEY", "") try: from google.colab import userdata secret_val = userdata.get("SIXTYFOUR_API_KEY") if secret_val: os.environ["SIXTYFOUR_API_KEY"] = secret_val API_KEY = secret_val except Exception: pass BASE_URL = "https://api.sixtyfour.ai" ENDPOINT = f"{BASE_URL}/find-phone" TIMEOUT_S = 180 print("✅ Setup complete (key detected, endpoint ready).") ``` -------------------------------- ### POST /enrich_lead (Sync) Source: https://docs.sixtyfour.ai/starter-notebooks/sixtyfour-enrich-lead-tutorial Submits a request to enrich lead information and returns a complete profile in a single call. Requires `lead_info` and `struct` in the request body. ```APIDOC ## POST /enrich_lead (Sync) ### Description This endpoint enriches lead information by providing a complete profile with a single request. It requires initial `lead_info` and a `struct` object to specify the desired information. ### Method POST ### Endpoint /enrich_lead ### Parameters #### Request Body - **lead_info** (object) - Required - The initial data available for the lead. - **name** (string) - Optional - The name of the lead. - **company** (string) - Optional - The company the lead is associated with. - **email** (string) - Optional - The email address of the lead. - **linkedin** (string) - Optional - The LinkedIn profile URL of the lead. - **struct** (object) - Required - Defines the specific information to be retrieved. - **name** (string) - Optional - Field for the individual's full name. - **email** (string) - Optional - Field for the individual's email address. - **phone** (string) - Optional - Field for the individual's phone number. - **company** (string) - Optional - Field for the company the individual is associated with. - **title** (string) - Optional - Field for the individual's job title. - **linkedin** (string) - Optional - Field for the LinkedIn URL of the person. - **website** (string) - Optional - Field for the company website URL. - **location** (string) - Optional - Field for the individual's or company's location. - **industry** (string) - Optional - Field for the industry the person operates in. - **github_url** (string) - Optional - Field for their GitHub profile URL. - **github_notes** (string) - Optional - Field for detailed notes on their GitHub profile. - **research_plan** (string) - Optional - A plan for how the research should be conducted. ### Request Example ```json { "lead_info": { "name": "LEAD_NAME", "company": "LEAD_COMPANY", "email": "LEAD_EMAIL", "linkedin": "LEAD_LINKEDIN" }, "struct": { "name": "The individual's full name", "email": "The individual's email address", "phone": "The individual's phone number", "company": "The company the individual is associated with", "title": "The individual's job title", "linkedin": "LinkedIn URL for the person", "website": "Company website URL", "location": "The individual's location and/or company location", "industry": "Industry the person operates in", "github_url": "url for their github profile", "github_notes": "Take detailed notes on their github profile." }, "research_plan": "Review LinkedIn, company website, and public profiles for contact info and role verification." } ``` ### Response #### Success Response (200) - **notes** (string) - General notes from the research. - **structured_data** (object) - An object containing the enriched lead information based on the `struct`. - **findings** (array) - A list of specific findings during the research. #### Response Example ```json { "notes": "Research completed successfully.", "structured_data": { "name": "Saarth Shah", "email": "saarth@sixtyfour.ai", "phone": "Not found", "company": "Sixtyfour AI", "title": "CEO & Co-Founder", "linkedin": "https://www.linkedin.com/in/saarthshah", "website": "https://sixtyfour.ai", "location": "San Francisco, CA", "industry": "AI/Technology", "github_url": "https://github.com/saarthshah", "github_notes": "Active GitHub profile with multiple repositories focused on AI and data processing tools." }, "findings": [ "Verified CEO role at Sixtyfour AI.", "Found active GitHub profile." ] } ``` ``` -------------------------------- ### Make First API Request with cURL Source: https://docs.sixtyfour.ai/ This snippet demonstrates how to make your first API request to the Sixtyfour AI platform using cURL. It includes the necessary endpoint, HTTP method, headers (API key and content type), and a JSON payload for enriching lead information. ```shellscript curl -X POST \"https://api.sixtyfour.ai/enrich-lead\" \ -H \"x-api-key: YOUR_API_KEY\" \ -H \"Content-Type: application/json\" \ -d '{ "lead_info": { "name": "Saarth Shah", "title": "CEO & Co-Founder @ Sixtyfour AI", "company": "Sixtyfour AI", "location": "San Francisco", "linkedin": "https://www.linkedin.com/in/saarthshah" }, ``` -------------------------------- ### Display Contact and Project Information Source: https://docs.sixtyfour.ai/ This snippet demonstrates how to display various pieces of information, such as contact details, website links, and project findings. It appears to be using a JSX-like syntax, common in React development, for rendering UI elements with associated styles. ```javascript const contactInfo = { ceo: "CEO \u0026 Co-Founder", linkedin: "https://www.linkedin.com/in/saarthshah", website: "https://www.sixtyfour.ai/", location: "San Francisco, California, USA", industry: "Artificial Intelligence and Sales Technology", github_url: "https://github.com/SaarthShah", github_notes: "Saarth Shah's GitHub profile demonstrates technical expertise with projects related to AI and full-stack development. Notable repositories include search spelling correction, AI chatbots, and data science models, corroborating his data science background." }; const findings = "..."; // Placeholder for actual findings data // Example of rendering this information (conceptual, actual implementation may vary) function renderInfo(info) { return (
{info.ceo}, "linkedin": "{info.linkedin}", "website": "{info.website}", "location": "{info.location}", "industry": "{info.industry}", "github_url": "{info.github_url}", "github_notes": "{info.github_notes}"
); } console.log(renderInfo(contactInfo)); console.log("findings: " + findings); ``` -------------------------------- ### Setup SixtyFour API Key and Endpoint Source: https://docs.sixtyfour.ai/starter-notebooks/sixtyfour-find-email-tutorial This Python snippet configures the necessary environment variables and constants for interacting with the SixtyFour API. It retrieves the API key from environment variables or Google Colab secrets and sets the base URL and endpoint for the find-email service. It also includes basic error handling for secret retrieval. ```python # --- Parameters (you can change these) --- LEAD_NAME = "Saarth Shah" LEAD_COMPANY = "Sixtyfour AI" # Fill as needed below. The more context, the better it performs. # LEAD_TITLE = "CEO" # LEAD_LINKEDIN = "https://www.linkedin.com/in/sarah-chen-photography" BRUTEFORCE = False # If True, tries common patterns + validation ONLY_COMPANY_EMAILS = True # If True, filters out personal emails (gmail, yahoo, etc.) import os, json, requests API_KEY = os.getenv("SIXTYFOUR_API_KEY", "") try: from google.colab import userdata secret_val = userdata.get("SIXTYFOUR_API_KEY") if secret_val: os.environ["SIXTYFOUR_API_KEY"] = secret_val API_KEY = secret_val except Exception: pass BASE_URL = "https://api.sixtyfour.ai" ENDPOINT = f"{BASE_URL}/find-email" TIMEOUT_S = 180 print("✅ Setup complete (key detected, endpoint ready).") ``` -------------------------------- ### JSON Example for Explicit Type Definition in Struct (JSON) Source: https://docs.sixtyfour.ai/api-reference/endpoint/enrich-company Illustrates how to explicitly define the data type for fields within the 'struct' in a JSON request. This example specifies 'employee_count' as an integer and 'is_verified' as a boolean, ensuring the API interprets and returns these fields with the correct types. ```json { "struct": { "employee_count": {"description": "Number of employees", "type": "int"}, "is_verified": {"description": "Verification status", "type": "bool"} } } ``` -------------------------------- ### POST /enrich_lead (Async) Source: https://docs.sixtyfour.ai/starter-notebooks/sixtyfour-enrich-lead-tutorial Initiates an asynchronous job to enrich lead information. Returns a `task_id` to poll for completion status and results. ```APIDOC ## POST /enrich_lead (Async) ### Description This endpoint starts an asynchronous job to enrich lead information. It returns a `task_id` that can be used to poll for the job's status and retrieve the results once completed. This is suitable for longer-running enrichment tasks. ### Method POST ### Endpoint /enrich_lead (async) ### Parameters #### Request Body - **lead_info** (object) - Required - The initial data available for the lead. - **name** (string) - Optional - The name of the lead. - **company** (string) - Optional - The company the lead is associated with. - **email** (string) - Optional - The email address of the lead. - **linkedin** (string) - Optional - The LinkedIn profile URL of the lead. - **struct** (object) - Required - Defines the specific information to be retrieved. - **name** (string) - Optional - Field for the individual's full name. - **email** (string) - Optional - Field for the individual's email address. - **phone** (string) - Optional - Field for the individual's phone number. - **company** (string) - Optional - Field for the company the individual is associated with. - **title** (string) - Optional - Field for the individual's job title. - **linkedin** (string) - Optional - Field for the LinkedIn URL of the person. - **website** (string) - Optional - Field for the company website URL. - **location** (string) - Optional - Field for the individual's or company's location. - **industry** (string) - Optional - Field for the industry the person operates in. - **github_url** (string) - Optional - Field for their GitHub profile URL. - **github_notes** (string) - Optional - Field for detailed notes on their GitHub profile. - **research_plan** (string) - Optional - A plan for how the research should be conducted. ### Request Example ```json { "lead_info": { "name": "LEAD_NAME", "company": "LEAD_COMPANY", "email": "LEAD_EMAIL", "linkedin": "LEAD_LINKEDIN" }, "struct": { "name": "The individual's full name", "email": "The individual's email address", "phone": "The individual's phone number", "company": "The company the individual is associated with", "title": "The individual's job title", "linkedin": "LinkedIn URL for the person", "website": "Company website URL", "location": "The individual's location and/or company location", "industry": "Industry the person operates in", "github_url": "url for their github profile", "github_notes": "Take detailed notes on their github profile." }, "research_plan": "Review LinkedIn, company website, and public profiles for contact info and role verification." } ``` ### Response #### Success Response (200) - **task_id** (string) - The unique identifier for the asynchronous job. #### Response Example ```json { "task_id": "abc123def456" } ``` ### Polling for Status #### Method GET #### Endpoint /status/{task_id} #### Parameters #### Path Parameters - **task_id** (string) - Required - The ID of the task to check the status for. #### Response ##### Success Response (200) - **status** (string) - The current status of the job (e.g., 'processing', 'completed', 'failed'). - **result** (object) - If status is 'completed', this contains the enriched data. - **error** (string) - If status is 'failed', this contains the error message. ##### Response Example ```json { "status": "completed", "result": { "notes": "Research completed successfully.", "structured_data": { "name": "Saarth Shah", "email": "saarth@sixtyfour.ai", "phone": "Not found", "company": "Sixtyfour AI", "title": "CEO & Co-Founder", "linkedin": "https://www.linkedin.com/in/saarthshah", "website": "https://sixtyfour.ai", "location": "San Francisco, CA", "industry": "AI/Technology", "github_url": "https://github.com/saarthshah", "github_notes": "Active GitHub profile with multiple repositories focused on AI and data processing tools." }, "findings": [ "Verified CEO role at Sixtyfour AI.", "Found active GitHub profile." ] } } ``` ``` -------------------------------- ### JSON Example for Type Override in Struct (JSON) Source: https://docs.sixtyfour.ai/api-reference/endpoint/enrich-company Demonstrates how to override the default type of a field within the 'struct' definition in a JSON payload. This example shows setting 'num_employees' to a string type, overriding its original integer type, and adding a new string field 'industry'. ```json { "target_company": {"num_employees": 25, "is_public": true}, "struct": { "num_employees": {"type": "str"}, // Overrides original int type "industry": "Primary business sector" // New field as string } } ``` -------------------------------- ### Represent User Data in JSON Format Source: https://docs.sixtyfour.ai/ This snippet demonstrates how to structure user data, including name, email, company, title, and contact links, in a JSON-like format. It highlights the use of string values for each field and includes common contact information fields. ```javascript { "name": "Saarth Shah", "email": "saarth@sixtyfour.ai", "company": "Sixtyfour AI", "title": "CEO & Co-Founder", "linkedin": "https://www.linkedin.com/in/saarthshah", "website": "https://www.sixtyfour.ai/", "location": "San Francisco, California, USA" } ``` -------------------------------- ### Send Data to SixtyFour AI API and Parse Response (Python) Source: https://docs.sixtyfour.ai/starter-notebooks/sixtyfour-qa-agent-tutorial This snippet demonstrates how to construct a JSON payload with candidate data, qualification criteria, references, and a desired output structure. It then sends this payload to the SixtyFour AI API endpoint using a POST request and handles the response, printing success or failure messages along with the structured data and notes from the API. ```python import requests import json # Assume ENDPOINT, API_KEY, TIMEOUT_S, data_obj, criteria, references are defined struct = { "suitability_score": "Overall qualification score (0-10)", "disqualification_reason": "Primary reason for disqualification if applicable", "final_verdict": "Clear YES/NO decision", "recommendation": "ACCEPT/REJECT with reasoning" } payload = { "data": data_obj, "qualification_criteria": criteria, "references": references, "struct": struct } resp = requests.post( ENDPOINT, headers={"x-api-key": API_KEY, "Content-Type": "application/json"}, json=payload, timeout=TIMEOUT_S, ) if resp.ok: result = resp.json() print("✅ Success! Keys:", list(result.keys())) print("\nStructured data:") print(json.dumps(result.get("structured_data", {}), indent=2)) print("\nNotes:") print(result.get("notes", "")) else: print("❌ Request failed:", resp.status_code, resp.text[:800]) ``` -------------------------------- ### Define Data, Criteria, and References for QA Agent Request (Python) Source: https://docs.sixtyfour.ai/starter-notebooks/sixtyfour-qa-agent-tutorial This Python code defines the data object, qualification criteria, and optional references for a request to the SixtyFour AI qa-agent API. The data object contains details about the entity being evaluated, criteria specify the conditions for qualification with weights and thresholds, and references provide URLs to guide research. ```python data_obj = { "name": DATA_NAME, "business_type": DATA_BUSINESS_TYPE, "follower_count": DATA_FOLLOWERS, "post_count": DATA_POSTS, "twitter_handle": DATA_POSTS, } criteria = [ { "criteria_name": "Follower count", "description": "Must have at least 2,500 followers", "weight": 10.0, "threshold": 8.0 }, { "criteria_name": "Target Market Location", "description": "Must be located in San Francisco", "weight": 8.0 } ] references = [ {"url": f"https://www.x.com/{DATA_TWITTER}", "description": "Twitter profile"} ] ``` -------------------------------- ### Check Job Status Endpoint Source: https://docs.sixtyfour.ai/api-reference/endpoint/enrich-lead This HTTP GET request is used to query the status of an asynchronous job using its unique task ID. ```http GET https://api.sixtyfour.ai/job-status/{task_id} ``` -------------------------------- ### Asynchronous Enrich Lead Request with Python Source: https://docs.sixtyfour.ai/starter-notebooks/sixtyfour-enrich-lead-tutorial Initiates an asynchronous job to enrich lead data, suitable for longer processing times. It starts the job, retrieves a task ID, polls for completion status, and retrieves the results upon successful completion. Error handling is included for failed jobs. ```python # Start async job start_resp = requests.post( ASYNC_ENDPOINT, headers={"x-api-key": API_KEY, "Content-Type": "application/json"}, json=payload, timeout=30, ) start_resp.raise_for_status() task_id = start_resp.json()["task_id"] print(f"🔄 Started async job: {task_id}") # Poll for completion while True: status_resp = requests.get( f"{STATUS_ENDPOINT}/{task_id}", headers={"x-api-key": API_KEY} ) status = status_resp.json() if status["status"] == "completed": async_result = status["result"] print("✅ Async job completed!") break elif status["status"] == "failed": raise RuntimeError(status.get("error", "Async job failed")) else: print(f"⏳ Status: {status['status']}") time.sleep(5) # Display results print("\nAsync Results:") print("="*50) async_structured_data = async_result.get("structured_data", {}) for key, value in async_structured_data.items(): print(f"{key}: {value}") ``` -------------------------------- ### Find Phone API No Phone Found Response Example Source: https://docs.sixtyfour.ai/api-reference/endpoint/find-phone When no phone number is found for a lead, the Find Phone API response will return an empty string for the 'phone' field. ```json { "name": "John Doe", "company": "Example Corp", "phone": "" } ```