### Check Lead Count with cURL (v3.0) Source: https://searchleads.readme.io/reference/noofleadscheck This example demonstrates how to check the count of leads using the SearchLeads API with version 3.0. It requires an API key for authentication and sends a JSON payload specifying pagination and job titles. ```curl curl -X POST "https://apis.searchleads.co/api/no_of_leads_check" \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "page": 1, "per_page": 10, "person_titles": ["CEO","CTO"], "include_similar_titles": true }' ``` -------------------------------- ### Check Number of Leads (JavaScript) Source: https://searchleads.readme.io/reference/search This JavaScript example shows how to make a POST request to the SearchLeads API to check the number of leads. It utilizes the `fetch` API to send a JSON payload and handles the response. ```javascript const url = 'https://apis.searchleads.co/api/no_of_leads_check'; const options = { method: 'POST', headers: { 'accept': 'application/json', 'content-type': 'application/json' }, body: JSON.stringify({ // Request body parameters go here, e.g.: // 'some_filter': 'value' }) }; fetch(url, options) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Create Export via Python Source: https://searchleads.readme.io/reference/exports This Python example illustrates how to create a lead export job using the `requests` library. It sends a POST request to the `/api/export` endpoint, including the required JSON body with filter, noOfLeads, and fileName parameters. ```python import requests import json url = "https://apis.searchleads.co/api/export" headers = { "accept": "application/json", "content-type": "application/json" } payload = { "filter": "export_v3", "noOfLeads": 100, "fileName": "leads_export.csv" } response = requests.post(url, headers=headers, data=json.dumps(payload)) if response.status_code == 201: print("Export created successfully:", response.json()) elif response.status_code == 400: print("Malformed request:", response.json()) elif response.status_code == 401: print("Authentication error:", response.json()) else: print(f"Error: {response.status_code}", response.json()) ``` -------------------------------- ### Create Export via cURL Source: https://searchleads.readme.io/reference/exports This example demonstrates how to create a lead export job using a cURL request. It specifies the API endpoint, HTTP method, and required headers. The request body should include filter, noOfLeads, and fileName parameters. ```shell curl --request POST \ --url https://apis.searchleads.co/api/export \ --header 'accept: application/json' \ --header 'content-type: application/json' ``` -------------------------------- ### Check Lead Count with cURL (v2.0) Source: https://searchleads.readme.io/reference/noofleadscheck This example demonstrates how to check the count of leads using the SearchLeads API with version 2.0. It requires an API key for authentication and sends a JSON payload specifying criteria like job titles, department, and industry. ```curl curl -X POST "https://apis.searchleads.co/api/no_of_leads_check" \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "person_titles": ["CEO","CTO"], "include_similar_titles": true, "person_department_or_subdepartments": ["Engineering & Technical","Product"], "organization_industry_display_name": ["information technology & services"] }' ``` -------------------------------- ### Check Number of Leads (Python) Source: https://searchleads.readme.io/reference/search This Python example illustrates how to use the `requests` library to send a POST request to the SearchLeads API for checking lead counts. It includes setting the appropriate headers and sending a JSON body. ```python import requests import json url = "https://apis.searchleads.co/api/no_of_leads_check" headers = { "accept": "application/json", "content-type": "application/json" } # Request body parameters would go here, e.g.: # payload = { # "some_filter": "value" # } response = requests.post(url, headers=headers, data=json.dumps(payload)) print(response.status_code) print(response.json()) ``` -------------------------------- ### Check Number of Leads (cURL) Source: https://searchleads.readme.io/reference/search This example demonstrates how to check the number of leads using the SearchLeads API with a cURL request. It specifies the POST method, the API endpoint, and the required headers for JSON content type and acceptance. ```shell curl --request POST \ --url https://apis.searchleads.co/api/no_of_leads_check \ --header 'accept: application/json' \ --header 'content-type: application/json' ``` -------------------------------- ### Get Export Result Source: https://searchleads.readme.io/reference/getexportresult Retrieves the final export after completion using the `LogID` returned at create time. The response format depends on the `outputFileFormat` parameter. ```APIDOC ## GET /api/logs/{LogID} ### Description Retrieves the final export after completion using the `LogID` returned at create time. The response format depends on the `outputFileFormat` parameter: - `json` (default): Returns full log details with lead data as JSON array - `csv`: Returns log metadata with Google Sheets CSV export URL - `xlsx`: Returns log metadata with Google Sheets Excel export URL - `pdf`: Returns log metadata with Google Sheets PDF export URL ### Method GET ### Endpoint `/api/logs/{LogID}` ### Parameters #### Path Parameters - **LogID** (string) - Required - The unique ID returned when the export was created. #### Query Parameters - **outputFileFormat** (string) - Optional - Format for the export data output. Allowed values: `json`, `csv`, `xlsx`, `pdf`. Defaults to `json`. ### Request Example ```json { "example": "GET /api/logs/5875125b-8cef-43e8-a613-221da57f328c?outputFileFormat=json" } ``` ### Response #### Success Response (200) - **log** (object) - Log result with full lead data (when outputFileFormat=json) - **LogID** (string) - The unique ID of the log. - **userID** (string) - The ID of the user who created the log. - **leadsRequested** (integer) - The number of leads requested in the job. - **leadsEnriched** (integer) - The number of leads successfully enriched. - **fileName** (string) - The name of the output file. - **creditsUsed** (integer) - The number of credits used for the job. - **url** (string) - URL for the exported data (e.g., Google Sheets link). - **status** (string) - The status of the log job (pending, completed, failed). - **date** (string) - The date and time the log was created. - **email** (string) - Email associated with the log. #### Response Example ```json { "example": "{\n \"log\": {\n \"LogID\": \"fceeb805-124c-4bf1-8df2-15d2af1eb8b0\",\n \"userID\": \"7b97f625-d549-4aa8-9492-0ccefa6b0efc\",\n \"leadsRequested\": 100,\n \"leadsEnriched\": 100,\n \"fileName\": \"test\",\n \"creditsUsed\": 63,\n \"url\": \"https://docs.google.com/spreadsheets/d/134lmZg3K2cvc9B4rF2R_vHNmirXLnc2KcTf9K3PeJfc\",\n \"status\": \"completed\",\n \"date\": \"2025-10-15T08:51:58.844Z\",\n \"email\": \"user@example.com\"\n }\n}" } ``` ``` -------------------------------- ### Check Export Status - Python Request Source: https://searchleads.readme.io/reference/checkexportstatus Example of how to check the export job status using Python's 'requests' library. This illustrates how to send a GET request with appropriate headers to the SearchLeads API. ```python import requests url = "https://apis.searchleads.co/api/logs/statusCheck/LogID" headers = { "accept": "application/json" } response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### Get Export Result Source: https://searchleads.readme.io/reference/getexportresult Retrieves the final export after completion using the `LogID` returned at create time. The response format depends on the `outputFileFormat` parameter. ```APIDOC ## GET /websites/searchleads/export/result ### Description Retrieves the final export after completion using the `LogID` returned at create time. The response format depends on the `outputFileFormat` parameter. ### Method GET ### Endpoint /websites/searchleads/export/result ### Parameters #### Query Parameters - **LogID** (string) - Required - The ID of the log to retrieve the export for. - **outputFileFormat** (string) - Optional - Specifies the desired output format. Options include 'json' (default), 'csv', 'xlsx', and 'pdf'. ### Request Example ```json { "example": "GET /websites/searchleads/export/result?LogID=abcdef12345&outputFileFormat=csv" } ``` ### Response #### Success Response (200) - **status** (string) - The status of the export process. - **data** (object or array) - The export data, format depends on `outputFileFormat`. - If `outputFileFormat` is 'json', `data` will be a JSON array of lead details. - If `outputFileFormat` is 'csv', 'xlsx', or 'pdf', `data` will contain metadata and a Google Sheets export URL. #### Response Example ```json { "example": { "status": "completed", "data": { "exportUrl": "https://docs.google.com/spreadsheets/d/e/..." } } } ``` ``` -------------------------------- ### Check Export Status - Shell Request Source: https://searchleads.readme.io/reference/checkexportstatus Example of how to check the export job status using a cURL request in Shell. This demonstrates the necessary URL, headers, and method to interact with the API. ```shell curl --request GET \ --url https://apis.searchleads.co/api/logs/statusCheck/LogID \ --header 'accept: application/json' ``` -------------------------------- ### Search Leads (POST /websites/searchleads_readme_io_reference) Source: https://searchleads.readme.io/reference/noofleadscheck This endpoint allows you to search for leads based on a comprehensive set of criteria. You can filter by account type, language skills, employee count, and more. It also supports custom sorting and field selection. ```APIDOC ## POST /websites/searchleads_readme_io_reference ### Description Searches for leads based on specified criteria, including account types, language skills, employee growth, and sorting preferences. ### Method POST ### Endpoint /websites/searchleads_readme_io_reference ### Parameters #### Query Parameters - **sort_ascending** (boolean) - Optional - Specifies if the sort order should be ascending. - **sort_by_field** (string) - Optional - The field to sort the results by. - **fields** (array of strings) - Optional - A list of fields to include in the response. #### Request Body - **items** (array of strings) - Optional - List of items to filter by. - **socialMediaLinkAccountExclude** (array of strings) - Optional - List of social media link accounts to exclude. - **accountTypeInclude** (array of strings) - Optional - List of account types to include. - **accountTypeExclude** (array of strings) - Optional - List of account types to exclude. - **languageSkills** (array of strings) - Optional - List of language skills to include. - **language_skills_mode** (string) - Optional - Mode for language skills filtering (e.g., AND, OR). - **languageSkillsExclude** (array of strings) - Optional - List of language skills to exclude. - **language_skills_exclude_mode** (string) - Optional - Mode for excluding language skills. - **language_skill_range** (object) - Optional - Range object for language skills. - **start** (integer) - Optional - Start of the range. - **end** (integer) - Optional - End of the range. - **operationLanguage** (array of strings) - Optional - List of operation languages to include. - **operationLanguageExclude** (array of strings) - Optional - List of operation languages to exclude. - **operation_language_range** (object) - Optional - Range object for operation languages. - **start** (integer) - Optional - Start of the range. - **end** (integer) - Optional - End of the range. - **employeeByFunction** (array of strings) - Optional - List of employee functions to filter by. - **employee_function_range** (object) - Optional - Range object for employee functions. - **start** (integer) - Optional - Start of the range. - **end** (integer) - Optional - End of the range. - **employeeByGrowth** (array of objects) - Optional - List of employee growth criteria. - **function** (array of strings) - Optional - List of functions for growth. - **start** (integer) - Optional - Start of the growth range. - **end** (integer) - Optional - End of the growth range. - **timeFrame** (string) - Optional - Time frame for growth. ### Request Example ```json { "accountTypeInclude": [ "Startup", "Enterprise" ], "languageSkills": [ "English", "Spanish" ], "employeeByGrowth": [ { "function": [ "Engineering" ], "start": 10, "end": 50, "timeFrame": "1y" } ], "sort_by_field": "employeeCount", "sort_ascending": true, "fields": [ "companyName", "website", "employeeCount" ] } ``` ### Response #### Success Response (200) - **companyName** (string) - The name of the company. - **website** (string) - The company's website URL. - **employeeCount** (integer) - The number of employees in the company. #### Response Example ```json { "results": [ { "companyName": "Tech Innovations Inc.", "website": "https://www.techinnovations.com", "employeeCount": 150 }, { "companyName": "Global Solutions Ltd.", "website": "https://www.globalsolutions.com", "employeeCount": 300 } ] } ``` ``` -------------------------------- ### GET /api/logs/{logId} Source: https://searchleads.readme.io/reference/getexportresult Retrieves logs associated with a specific log ID. Supports various output formats like JSON, CSV, Excel, and PDF. ```APIDOC ## GET /api/logs/{logId} ### Description Retrieves logs associated with a specific log ID. Supports various output formats like JSON, CSV, Excel, and PDF. ### Method GET ### Endpoint /api/logs/{logId} #### Path Parameters - **logId** (string) - Required - The unique identifier for the log. #### Query Parameters - **outputFileFormat** (string) - Optional - Specifies the desired output format. Accepts `json`, `csv`, `xlsx`, or `pdf`. Defaults to `json`. ### Request Example ```bash curl -X GET "https://apis.searchleads.co/api/logs/fceeb805-124c-4bf1-8df2-15d2af1eb8b0?outputFileFormat=json" \ -H "Authorization: Bearer YOUR_API_KEY" ``` ### Response #### Success Response (200) - **message** (string) - A success message. - **details** (object) - An object containing the log data, structure depends on `outputFileFormat`. #### Response Example ```json { "message": "Log retrieved successfully", "details": {} } ``` #### Error Response (404) - **message** (string) - Error message indicating the resource was not found. - **details** (object) - Additional details about the error. #### Error Response Example ```json { "message": "Not Found" } ``` ``` -------------------------------- ### Check Export Status Source: https://searchleads.readme.io/reference/checkexportstatus Retrieves the processing status of an export job using its unique LogID. This is a GET request that returns the current status of the job. ```APIDOC ## GET /api/logs/statusCheck/{LogID} ### Description Checks the processing status of an export job. This endpoint is used to track the progress of an export initiated previously. ### Method GET ### Endpoint `https://apis.searchleads.co/api/logs/statusCheck/{LogID}` ### Parameters #### Path Parameters - **LogID** (string) - Required - The unique ID returned when the export was created. #### Query Parameters None #### Request Body None ### Request Example ```bash curl --request GET \ --url 'https://apis.searchleads.co/api/logs/statusCheck/YOUR_LOG_ID' \ --header 'accept: application/json' ``` ### Response #### Success Response (200) - **log** (object) - Contains the log details. - **LogID** (string) - The unique ID of the log. - **status** (string) - The current status of the job. Enum: `pending`, `completed`, `failed`. #### Response Example (200 OK) ```json { "log": { "LogID": "string", "status": "completed" } } ``` #### Error Response (401 Unauthorized) - **message** (string) - Indicates an authentication issue. - **details** (object) - Contains additional details about the error. #### Response Example (401 Unauthorized) ```json { "message": "Missing or invalid authentication.", "details": {} } ``` #### Error Response (404 Not Found) - **message** (string) - Indicates the resource was not found. - **details** (object) - Contains additional details about the error. #### Response Example (404 Not Found) ```json { "message": "Resource not found.", "details": {} } ``` ``` -------------------------------- ### Create Export via JavaScript Source: https://searchleads.readme.io/reference/exports This JavaScript snippet shows how to programmatically create a lead export job. It uses the `fetch` API to send a POST request to the `/api/export` endpoint with the necessary JSON payload, including filter, noOfLeads, and fileName. ```javascript const url = 'https://apis.searchleads.co/api/export'; const options = { method: 'POST', headers: { 'accept': 'application/json', 'content-type': 'application/json' }, body: JSON.stringify({ filter: 'export_v3', noOfLeads: 100, fileName: 'leads_export.csv' }) }; fetch(url, options) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error creating export:', error)); ``` -------------------------------- ### Retrieve Logs in Different Formats (cURL) Source: https://searchleads.readme.io/reference/getexportresult Demonstrates how to retrieve log data from the SearchLeads API in JSON, CSV, Excel, and PDF formats using cURL. Requires an API key for authorization. The output format is controlled by the `outputFileFormat` query parameter. ```curl curl -X GET "https://apis.searchleads.co/api/logs/fceeb805-124c-4bf1-8df2-15d2af1eb8b0?outputFileFormat=json" \ -H "Authorization: Bearer 5c08329b-042f-4fc1-817e-88dc6f2c8c5f" ``` ```curl curl -X GET "https://apis.searchleads.co/api/logs/fceeb805-124c-4bf1-8df2-15d2af1eb8b0?outputFileFormat=csv" \ -H "Authorization: Bearer 5c08329b-042f-4fc1-817e-88dc6f2c8c5f" ``` ```curl curl -X GET "https://apis.searchleads.co/api/logs/fceeb805-124c-4bf1-8df2-15d2af1eb8b0?outputFileFormat=xlsx" \ -H "Authorization: Bearer 5c08329b-042f-4fc1-817e-88dc6f2c8c5f" ``` ```curl curl -X GET "https://apis.searchleads.co/api/logs/fceeb805-124c-4bf1-8df2-15d2af1eb8b0?outputFileFormat=pdf" \ -H "Authorization: Bearer 5c08329b-042f-4fc1-817e-88dc6f2c8c5f" ``` -------------------------------- ### POST /websites/searchleads_readme_io_reference/exports Source: https://searchleads.readme.io/reference/createexport Initiates a new lead export job by specifying the desired filters for the export. This endpoint is used to programmatically generate lead export files. ```APIDOC ## POST /websites/searchleads_readme_io_reference/exports ### Description Creates a new lead export job with the specified filters. ### Method POST ### Endpoint /websites/searchleads_readme_io_reference/exports ### Parameters #### Request Body - **filters** (object) - Required - An object containing the criteria to filter leads for the export. The exact structure of the filters object depends on the available filtering options for lead exports. ### Request Example ```json { "filters": { "lead_status": "converted", "date_range": { "start_date": "2023-01-01", "end_date": "2023-12-31" } } } ``` ### Response #### Success Response (201 Created) - **job_id** (string) - The unique identifier for the created export job. - **status** (string) - The initial status of the export job (e.g., "pending", "processing"). #### Response Example ```json { "job_id": "export-job-12345", "status": "pending" } ``` ``` -------------------------------- ### POST /api/export Source: https://searchleads.readme.io/reference/exports Creates a new lead export job with the specified filters. ```APIDOC ## POST /api/export ### Description Creates a new lead export job with the specified filters. ### Method POST ### Endpoint https://apis.searchleads.co/api/export ### Parameters #### Request Body - **filter** (object) - Required - Used to filter leads for the export. - **noOfLeads** (integer) - Required - Minimum value of 1. - **fileName** (string) - Required - The name of the export file. ### Request Example ```json { "filter": { "export_v3": "some_value" }, "noOfLeads": 100, "fileName": "leads_export" } ``` ### Response #### Success Response (201) - **message** (string) - Indicates that the export was created successfully. - **log_id** (string) - Unique ID for the created export job. #### Response Example (201) ```json { "message": "Export created successfully.", "log_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef" } ``` #### Error Responses - **400 Malformed request**: The request could not be understood or processed. - **401 Missing or invalid authentication**: Authentication credentials are required or invalid. - **422 Validation error**: The request failed validation. ``` -------------------------------- ### Export Leads via cURL Source: https://searchleads.readme.io/reference/createexport This snippet demonstrates how to export leads from the Searchleads API using a cURL command. It requires an API key for authentication and sends a JSON payload to specify export filters, including job titles, similar titles, desired fields, the number of leads, and the output file name. ```curl curl -X POST "https://apis.searchleads.co/api/export" \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "filter": { "person_titles": ["CEO","CTO"], "include_similar_titles": true, "fields": ["id","first_name","last_name","title","organization","email"] }, "noOfLeads": 100, "fileName": "lead_export" }' ``` -------------------------------- ### POST /api/export Source: https://searchleads.readme.io/reference/createexport Initiates an export job to generate a list of leads based on specified filters and criteria. Returns a unique ID for tracking the export process. ```APIDOC ## POST /api/export ### Description Initiates an export job to generate a list of leads based on specified filters and criteria. Returns a unique ID for tracking the export process. ### Method POST ### Endpoint /api/export ### Parameters #### Request Body - **filter** (object) - Required - Specifies the criteria for filtering leads. - **page** (integer) - Optional - The page number for pagination. - **per_page** (integer) - Optional - The number of results per page. - **person_titles** (array[string]) - Optional - A list of job titles to filter by. - **include_similar_titles** (boolean) - Optional - Whether to include similar job titles. - **fields** (array[string]) - Optional - A list of fields to include in the export. - **noOfLeads** (integer) - Required - The maximum number of leads to export. - **fileName** (string) - Required - The desired name for the export file. ### Request Example ```json { "filter": { "page": 1, "per_page": 100, "person_titles": [ "CEO", "CTO" ], "include_similar_titles": true, "fields": [ "id", "first_name", "last_name", "title", "organization", "email" ] }, "noOfLeads": 100, "fileName": "lead_export" } ``` ### Response #### Success Response (201) - **message** (string) - A confirmation message indicating the export was created. - **log_id** (string) - Unique ID for the created export job. #### Response Example ```json { "message": "Export created successfully", "log_id": "5875125b-8cef-43e8-a613-221da57f328c" } ``` #### Error Response (400) - **message** (string) - Indicates a malformed request. - **details** (object) - Additional details about the error. #### Error Response Example ```json { "message": "Bad Request" } ``` #### Error Response (401) - **message** (string) - Indicates missing or invalid authentication. - **details** (object) - Additional details about the error. #### Error Response Example ```json { "message": "Unauthorized" } ``` #### Error Response (422) - **message** (string) - Indicates a validation error. - **details** (object) - Additional details about the error. ``` -------------------------------- ### Check Export Status - JavaScript Request Source: https://searchleads.readme.io/reference/checkexportstatus Example of how to check the export job status using JavaScript's Fetch API. This shows how to construct the request with the correct URL and headers for an asynchronous API call. ```javascript fetch('https://apis.searchleads.co/api/logs/statusCheck/LogID', { method: 'GET', headers: { 'accept': 'application/json' } }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Search Leads - Log Result With URL Source: https://searchleads.readme.io/reference/getexportresult This endpoint retrieves lead data based on specified criteria and returns a log of the operation along with a URL for accessing the exported data. The output format can be specified as JSON or CSV. ```APIDOC ## POST /search/leads ### Description This endpoint allows you to search for leads based on various criteria and receive the results in a specified format (JSON or CSV). It returns a log of the operation and a URL to access the exported data. ### Method POST ### Endpoint /search/leads ### Parameters #### Query Parameters - **outputFileFormat** (string) - Optional - Specifies the desired output format for the exported data. Accepted values are 'json' or 'csv'. Defaults to 'json'. #### Request Body - **searchRequest** (object) - Required - Contains the search criteria and export details. - **leadsRequested** (integer) - Required - The number of leads to request. - **fileName** (string) - Required - The name for the exported file. - **email** (string) - Required - The email address to associate with the request. - **name** (string) - Optional - The name associated with the request. - **valid_email_count** (integer) - Optional - The expected count of valid emails. - **filter** (string) - Optional - A JSON string containing the filter criteria. Example: `"{\"person_titles\":[\"CEO\"]}"` ### Request Example ```json { "searchRequest": { "leadsRequested": 100, "fileName": "test", "email": "lakshay@healdns.com", "name": "Lakshay Taneja", "valid_email_count": 63, "filter": "{\"person_titles\":[\"CEO\"]}" } } ``` ### Response #### Success Response (200) - **log** (object) - Contains details about the lead search operation. - **LogID** (string) - Unique identifier for the log entry. - **userID** (string) - The ID of the user who made the request. - **leadsRequested** (integer) - The number of leads requested. - **leadsEnriched** (integer) - The number of leads enriched. - **fileName** (string) - The name of the exported file. - **creditsUsed** (integer) - The number of credits used for the request. - **url** (string) - The base URL for accessing the exported data. - **status** (string) - The status of the operation (e.g., 'completed'). - **date** (string) - The date and time the operation was completed. - **email** (string) - The email provided in the request. - **name** (string) - The name provided in the request. - **valid_email_count** (integer) - The count of valid emails. - **filter** (string) - The filter criteria used in the request. - **data** (object or string) - The lead data. This will be an object for JSON format or a URI string for CSV format, pointing to the exported file. #### Response Example (JSON Format) ```json { "log": { "LogID": "fceeb805-124c-4bf1-8df2-15d2af1eb8b0", "userID": "7b97f625-d549-4aa8-9492-0ccefa6b0efc", "leadsRequested": 100, "leadsEnriched": 100, "fileName": "test", "creditsUsed": 63, "url": "https://docs.google.com/spreadsheets/d/134lmZg3K2cvc9B4rF2R_vHNmirXLnc2KcTf9K3PeJfc", "status": "completed", "date": "2025-10-15T08:51:58.844Z", "email": "lakshay@healdns.com", "name": "Lakshay Taneja", "valid_email_count": 63, "filter": "{\"person_titles\":[\"CEO\"]}", "data": [ { "index": "2f2e1782-acbc-44da-9ba6-b36b70792d85", "id": "609ad97bdba3a000012c76f0", "first_name": "Evan", "last_name": "Kramer", "email": "ekramer@motionpoint.com", "email_status": "Catch All Valid", "title": "Chief Executive Officer (CEO)", "organization_name": "MarketFully Group" } ] } } ``` #### Response Example (CSV Format) ```json { "log": { "LogID": "fceeb805-124c-4bf1-8df2-15d2af1eb8b0", "userID": "7b97f625-d549-4aa8-9492-0ccefa6b0efc", "leadsRequested": 100, "leadsEnriched": 100, "fileName": "test", "creditsUsed": 63, "url": "https://docs.google.com/spreadsheets/d/134lmZg3K2cvc9B4rF2R_vHNmirXLnc2KcTf9K3PeJfc", "status": "completed", "date": "2025-10-15T08:51:58.844Z", "email": "lakshay@healdns.com", "name": "Lakshay Taneja", "valid_email_count": 63, "filter": "{\"person_titles\":[\"CEO\"]}", "data": "https://docs.google.com/spreadsheets/d/134lmZg3K2cvc9B4rF2R_vHNmirXLnc2KcTf9K3PeJfc/export?format=csv" } } ``` ### Error Handling #### Unauthorized (401) - **message** (string) - A message indicating that the request is unauthorized. - **details** (object) - Additional details about the authorization error. #### Response Example (401) ```json { "message": "Unauthorized", "details": {} } ``` ``` -------------------------------- ### Check Export Status API Endpoint Source: https://searchleads.readme.io/reference/logs This section details the 'Check Export Status' API endpoint, which allows you to query the processing status of an export job using its unique LogID. It specifies the request method (GET), URL structure, required path parameters, and possible response codes and bodies, including success, authentication failure, and resource not found scenarios. ```shell curl --request GET \ --url https://apis.searchleads.co/api/logs/statusCheck/LogID \ --header 'accept: application/json' ``` ```javascript const url = `https://apis.searchleads.co/api/logs/statusCheck/${LogID}`; fetch(url, { method: 'GET', headers: { 'accept': 'application/json' } }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` ```python import requests log_id = "YOUR_LOG_ID" url = f"https://apis.searchleads.co/api/logs/statusCheck/{log_id}" headers = { "accept": "application/json" } response = requests.get(url, headers=headers) print(response.status_code) print(response.json()) ``` -------------------------------- ### POST /api/export - Create Export Source: https://searchleads.readme.io/reference/createexport This endpoint creates a new lead export job. You can specify various filters to define the leads you want to export, along with the desired number of leads and the filename for the export. ```APIDOC ## POST /api/export ### Description Creates a new lead export job with the specified filters. ### Method POST ### Endpoint https://apis.searchleads.co/api/export ### Parameters #### Query Parameters None #### Request Body - **filter** (object) - Required - Specifies the criteria for lead selection. This can include titles, locations, and more. - **noOfLeads** (integer) - Required - The desired number of leads to include in the export. - **fileName** (string) - Required - The name for the generated export file. **Filter Object Properties:** - **page** (integer) - Optional - The page number for pagination within the filter. - **per_page** (integer) - Optional - The number of items per page for pagination within the filter. - **person_titles** (array of strings) - Optional - A list of job titles to include. - **include_similar_titles** (boolean) - Optional - Whether to include titles similar to those specified. - **person_titles_mode** (string) - Optional - The mode for matching person titles (e.g., 'AND', 'OR'). - **person_not_titles** (array of strings) - Optional - A list of job titles to exclude. - **person_not_titles_mode** (string) - Optional - The mode for matching excluded person titles. - **person_titles_prev** (array of strings) - Optional - Previous person titles to consider. - **person_titles_prev_mode** (string) - Optional - The mode for matching previous person titles. - **person_not_titles_prev** (array of strings) - Optional - Previous person titles to exclude. - **person_not_titles_prev_mode** (string) - Optional - The mode for matching excluded previous person titles. - **person_locations** (array of objects) - Optional - A list of locations to filter by. - **name** (string) - Required - The name of the location. - **countryCode** (string) - Required - The ISO 3166-1 alpha-2 country code. - **stateCode** (string) - Optional - The state or region code. - **company_locations** (array of objects) - Optional - A list of company locations to filter by. - **name** (string) - Required - The name of the location. - **countryCode** (string) - Required - The ISO 3166-1 alpha-2 country code. - **stateCode** (string) - Optional - The state or region code. ### Request Example ```json { "filter": { "person_titles": ["Software Engineer", "Data Scientist"], "person_locations": [ { "name": "San Francisco", "countryCode": "US", "stateCode": "CA" } ] }, "noOfLeads": 100, "fileName": "software_engineers_sf" } ``` ### Response #### Success Response (200) - **job_id** (string) - The unique identifier for the created export job. - **status** (string) - The initial status of the export job (e.g., 'pending'). #### Response Example ```json { "job_id": "export_job_12345", "status": "pending" } ``` ``` -------------------------------- ### POST /api/export Source: https://searchleads.readme.io/reference/createexport This endpoint allows you to export leads based on specified filters and criteria. You can define person titles, include similar titles, select fields, set the number of leads, and name the export file. Authentication is required using an API Key. ```APIDOC ## POST /api/export ### Description This endpoint allows you to export leads based on specified filters and criteria. You can define person titles, include similar titles, select fields, set the number of leads, and name the export file. Authentication is required using an API Key. ### Method POST ### Endpoint /api/export ### Parameters #### Query Parameters None #### Request Body - **filter** (object) - Required - Filter criteria for lead export. - **person_titles** (array of strings) - Required - A list of job titles to filter by. - **include_similar_titles** (boolean) - Required - Whether to include similar job titles. - **fields** (array of strings) - Required - A list of fields to include in the export. - **noOfLeads** (integer) - Required - The maximum number of leads to export. - **fileName** (string) - Required - The name of the exported file. ### Request Example ```json { "filter": { "person_titles": ["CEO","CTO"], "include_similar_titles": true, "fields": ["id","first_name","last_name","title","organization","email"] }, "noOfLeads": 100, "fileName": "lead_export" } ``` ### Response #### Success Response (200) This endpoint typically returns a success status upon successful request initiation. The actual lead file is usually provided via a separate mechanism or download link, which is not detailed in this snippet. #### Response Example ```json { "message": "Export initiated successfully" } ``` #### Error Response (422) - **error** (object) - Details about the unprocessable entity error. - **code** (string) - Error code. - **message** (string) - Error message. #### Error Response Example ```json { "error": { "code": "unprocessable_entity", "message": "Unprocessable Entity" } } ``` ``` -------------------------------- ### SearchLeads Filters Source: https://searchleads.readme.io/reference/createexport This section details the various filters available for searching leads. These include date ranges, amount ranges, existence of fields, social media related fields, and account types. ```APIDOC ## SearchLeads Filters ### Description This endpoint allows for filtering leads based on a comprehensive set of criteria. You can specify ranges for dates and amounts, include or exclude specific fields, and filter by social media presence and account types. ### Method GET (assumed for filtering) ### Endpoint /websites/searchleads ### Parameters #### Query Parameters - **min_date** (string) - Optional - Minimum date for filtering. - **max_date** (string) - Optional - Maximum date for filtering. - **min_amount** (string) - Optional - Minimum amount for filtering. - **max_amount** (string) - Optional - Maximum amount for filtering. - **exist_fields** (array of strings) - Optional - Fields that must exist. - **not_exist_fields** (array of strings) - Optional - Fields that must not exist. - **last_funding_date_range** (object) - Optional - Range for the last funding date. - **min** (integer) - Minimum value for the last funding date. - **max** (integer) - Maximum value for the last funding date. - **last_funding_amount_range** (object) - Optional - Range for the last funding amount. - **min** (string) - Minimum value for the last funding amount. - **max** (string) - Maximum value for the last funding amount. - **organization_founded_year_range** (object) - Optional - Range for the organization founded year. - **min** (string) - Minimum value for the founded year. - **max** (string) - Maximum value for the founded year. - **socialMediaContact** (array of strings) - Optional - Social media contacts to include. - **socialMediaContactExclude** (array of strings) - Optional - Social media contacts to exclude. - **socialMediaLinkContact** (array of strings) - Optional - Social media links for contacts to include. - **socialMediaLinkContactExclude** (array of strings) - Optional - Social media links for contacts to exclude. - **socialMediaAccount** (array of strings) - Optional - Social media accounts to include. - **socialMediaAccountExclude** (array of strings) - Optional - Social media accounts to exclude. - **socialMediaLinkAccount** (array of strings) - Optional - Social media links for accounts to include. - **socialMediaLinkAccountExclude** (array of strings) - Optional - Social media links for accounts to exclude. - **accountTypeInclude** (array of strings) - Optional - Account types to include. ### Request Example ```json { "min_date": "2023-01-01", "exist_fields": ["email", "phone"], "last_funding_date_range": { "min": 1672531200, "max": 1675209600 }, "socialMediaContact": ["linkedin", "twitter"] } ``` ### Response #### Success Response (200) - **leads** (array) - An array of lead objects matching the specified criteria. #### Response Example ```json { "leads": [ { "id": "123e4567-e89b-12d3-a456-426614174000", "name": "Example Corp", "email": "contact@example.com", "phone": "123-456-7890" } ] } ``` ```