### cURL Request Example Source: https://docs.baselayer.com/reference/business Example of how to make a GET request to the Baselayer API to retrieve business details by ID. This includes the necessary URL and headers for authentication and content negotiation. ```shell curl --request GET \ --url https://api.baselayer.com/businesses/id \ --header 'accept: application/json' ``` -------------------------------- ### Complete Baselayer Integration Flow in Python Source: https://docs.baselayer.com/docs/getting-started This Python script provides a comprehensive example of integrating with the Baselayer API. It covers initiating a business search, polling for completion, extracting the business ID, and then initiating subsequent Lien and Portfolio Monitoring searches. It utilizes the `requests` library and includes basic error handling and status checks. ```python import requests import time API_KEY = "your_api_key_here" BASE_URL = "https://api.baselayer.com" # Step 1: Create business search response = requests.post( f"{BASE_URL}/searches", headers={"X-API-Key": API_KEY, "Content-Type": "application/json"}, json={ "name": "Baselayer Technologies Inc", "address": "149 New Montgomery St, San Francisco, CA 94105" } ) search_id = response.json()["id"] print(f"Search initiated: {search_id}") # Step 2: Wait for webhook OR poll for completion time.sleep(5) # Wait for processing (3-5 seconds without options) search_result = requests.get( f"{BASE_URL}/searches/{search_id}", headers={"X-API-Key": API_KEY} ).json() if search_result["state"] == "COMPLETED": # Business data is included in the search result business = search_result["business"] business_id = business["id"] print(f"Business verified: {business_id}") print(f"Business name: {business['name']}") # Step 3: Branch to other products using business_id # Example: Search for liens liens_response = requests.post( f"{BASE_URL}/liens_searches", headers={"X-API-Key": API_KEY, "Content-Type": "application/json"}, json={"business_id": business_id} ) liens_search_id = liens_response.json()["id"] print(f"Liens search initiated: {liens_search_id}") # Example: Add to portfolio monitoring portfolio_response = requests.post( f"{BASE_URL}/portfolio/items", headers={"X-API-Key": API_KEY, "Content-Type": "application/json"}, json={ "search_id": search_id } ) print(f"Added to portfolio monitoring") ``` -------------------------------- ### Get Portfolio Item Snapshot - Node.js Example Source: https://docs.baselayer.com/reference/get_portfolio_item_snapshot_portfolio_items__item_id__snapshots__snapshot_id__get-1 Example of how to fetch a portfolio item snapshot using Node.js. This code snippet assumes you have a library like 'axios' installed for making HTTP requests. It sends a GET request to the specified API endpoint. ```javascript const axios = require('axios'); async function getPortfolioSnapshot(itemId, snapshotId) { try { const response = await axios.get(`https://api.baselayer.com/portfolio/items/${itemId}/snapshots/${snapshotId}`, { headers: { 'accept': 'application/json' } }); return response.data; } catch (error) { console.error('Error fetching portfolio snapshot:', error); throw error; } } // Example usage: // getPortfolioSnapshot('3fa85f64-5717-4562-b3fc-2c963f66afa6', '3fa85f64-5717-4562-b3fc-2c963f66afa6') // .then(data => console.log(data)) // .catch(err => console.error(err)); ``` -------------------------------- ### Sandbox Search Input Validation Example Source: https://docs.baselayer.com/docs/business-search This example highlights the sensitivity of sandbox search inputs. It shows a correct address format that works in sandbox and an incorrect one that would cause the search to fail due to extra characters. ```json { "address": "2327 Hill Church Houston Rd, Canonsburg PA 15317" } { "address": "2327 Hill Church Houston Rd, Canonsburg PA 15317, US" } ``` -------------------------------- ### Make a Pre.Fill Request using Python Source: https://docs.baselayer.com/docs/business-prefill-api-quickstart This Python function uses the httpx library to make a GET request to the Pre.Fill API. It takes the officer's name, an optional business name, and an API key as input. The function constructs the query parameters and headers, sends the request, and returns the JSON response or raises an exception on error. ```python import httpx import json async def get_business_prefill( officer_name: str, business_name: str = None, api_key: str = None ) -> dict: """ Get business registrations for an officer Parameters: officer_name (str): The officer's full name business_name (str): Optional business name to match against api_key (str): Your Baselayer API key Returns: dict: Pre.Fill response with business registrations """ url = "https://api.baselayer.com/prefill" # Build query parameters params = { "officer_name": officer_name } if business_name: params["business_name"] = business_name headers = { "X-API-Key": api_key } try: async with httpx.AsyncClient() as client: response = await client.get( url, params=params, headers=headers ) response.raise_for_status() return response.json() except Exception as e: print(f"Error fetching pre-fill data: {str(e)}") raise ``` -------------------------------- ### Business Search Response Source: https://docs.baselayer.com/docs/getting-started Example JSON response after initiating a business search. It includes the 'search_id', 'state', and 'created_at' timestamp for the submitted request. ```json { "id": "a1b2c3d4-5678-90ab-cdef-1234567890ab", // search_id "state": "SUBMITTED", "created_at": "2025-12-29T10:15:30Z" } ``` -------------------------------- ### Get Person Searches API Request (Node.js) Source: https://docs.baselayer.com/reference/person-search Example of making a GET request to the Get Person Searches API using Node.js with the 'axios' library. It includes setting the URL and 'accept' header. This example does not include query parameters. ```javascript const axios = require('axios'); const options = { method: 'GET', url: 'https://api.baselayer.com/person_searches', headers: { 'accept': 'application/json' } }; axios.request(options).then(function (response) { console.log(response.data); }).catch(function (error) { console.error(error); }); ``` -------------------------------- ### Create Portfolio Item Source: https://docs.baselayer.com/docs/portfolio-monitoring-api-quickstart Creates a new item in the portfolio for monitoring. Requires a `business_search_id` obtained from a previous search. ```APIDOC ## POST /portfolio/items ### Description Creates a new item in the portfolio for monitoring. Requires a `business_search_id` obtained from a previous search. ### Method POST ### Endpoint /portfolio/items ### Parameters #### Query Parameters None #### Request Body - **business_search_id** (string) - Required - The ID of the business search result to create a portfolio item from. ### Request Example ```json { "business_search_id": "search_abc123" } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the newly created portfolio item. #### Response Example ```json { "id": "portfolio_item_xyz789" } ``` ``` -------------------------------- ### Get Person Searches API Request (Python) Source: https://docs.baselayer.com/reference/person-search Example of making a GET request to the Get Person Searches API using Python's 'requests' library. It shows how to specify the URL and the 'accept' header. This example does not include any query parameters. ```python import requests url = "https://api.baselayer.com/person_searches" headers = { "accept": "application/json" } response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### Make a Business Search Request with Order Options (cURL) Source: https://docs.baselayer.com/docs/business-search This example demonstrates how to make a POST request to the Baselayer API to perform a business search, including optional add-ons like Website Analysis and Naics Prediction. The `options` array in the JSON payload specifies which add-ons to enable. ```cURL curl --request POST \ --url https://api.baselayer.com/searches \ --header 'X-API-Key: ' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ \ "name": "Howard Concrete Pumping Co Inc", \ "address": "2327 Hill Church Houston Rd, Canonsburg PA 15317", \ "officer_names": [ \ "Frank Howard Jr" \ ], \ "options": ["Order.WebsiteAnalysis", "Order.NaicsPrediction"], \ "tin": "123456789" \ }' ``` -------------------------------- ### POST /searches Source: https://docs.baselayer.com/docs/business-prefill-api-quickstart Initiates a Business Search using pre-filled business data and applicant-provided Tax ID (EIN) to perform a full KYB verification. ```APIDOC ## POST /searches ### Description This endpoint performs a comprehensive Know Your Business (KYB) verification by searching for a business using its name, address, and Tax Identification Number (TIN). ### Method POST ### Endpoint /searches ### Parameters #### Request Body - **name** (string) - Required - The legal name of the business. - **address** (object) - Required - The primary address of the business. - **street** (string) - Required - The street address. - **city** (string) - Required - The city. - **state** (string) - Required - The state or province. - **zip** (string) - Required - The ZIP or postal code. - **tin** (string) - Required - The Tax Identification Number (e.g., EIN) of the business. ### Request Example ```json { "name": "Alma Oasis Med Spa & IV Hydration, PC", "address": { "street": "1183 E Foothill Blvd Ste 135", "city": "Upland", "state": "CA", "zip": "91786" }, "tin": "12-3456789" } ``` ### Response #### Success Response (200) - **registration_status** (string) - The current standing of the business registration. - **officers** (array) - A list of the business's registered officers. - **sanctions** (array) - A list of any sanctions associated with the business. - **other_kyb_data** (object) - Comprehensive KYB data. #### Response Example ```json { "registration_status": "Active", "officers": [ { "name": "Jane Doe", "title": "President" } ], "sanctions": [], "other_kyb_data": { "industry": "Healthcare", "incorporation_date": "2020-01-15" } } ``` ``` -------------------------------- ### Get Liens Search Status - PHP Example Source: https://docs.baselayer.com/reference/get_liens_search_status_lien_searches__liens_search_request_id__status_get-1 A PHP example demonstrating how to retrieve lien search status using cURL. This code sends a GET request and outputs the JSON response. ```php ``` -------------------------------- ### Search for Businesses Source: https://docs.baselayer.com/docs/portfolio-monitoring-api-quickstart Initiates a search for businesses based on name and address. The results include business details, scores, and match quality. ```APIDOC ## POST /searches ### Description Initiates a search for businesses based on name and address. The results include business details, scores, and match quality. ### Method POST ### Endpoint /searches ### Parameters #### Query Parameters None #### Request Body - **name** (string) - Required - The name of the business to search for. - **address** (string) - Required - The address of the business to search for. ### Request Example ```json { "name": "Example Business", "address": "123 Main St, Anytown, USA" } ``` ### Response #### Success Response (200) - **business** (object) - Details about the business found. - **scores** (object) - Scoring information related to the business. - **match_quality** (number) - The quality of the match. #### Response Example ```json { "business": { "name": "Example Business", "address": "123 Main St, Anytown, USA" }, "scores": { "risk_score": 85 }, "match_quality": 0.95 } ``` ``` -------------------------------- ### Get Liens Search Status - Node.js Example Source: https://docs.baselayer.com/reference/get_liens_search_status_lien_searches__liens_search_request_id__status_get-1 Example of fetching lien search status in Node.js using the 'node-fetch' library. This code makes a GET request to the API endpoint and logs the response. ```javascript const fetch = require('node-fetch'); const options = { method: 'GET', headers: { 'accept': 'application/json' } }; fetch('https://api.baselayer.com/lien_searches/liens_search_request_id/status', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err)); ``` -------------------------------- ### POST /searches - Business Search with Order Options Source: https://docs.baselayer.com/docs/business-search Initiates a business search with optional add-ons to enrich verification data. Note that Order Options are only supported for asynchronous searches. ```APIDOC ## POST /searches ### Description Initiates a business search with optional add-ons to enrich verification data. Order Options are only supported for asynchronous searches. Synchronous requests including options will fail. ### Method POST ### Endpoint /searches ### Parameters #### Query Parameters None #### Request Body - **name** (string) - Required - The name of the business to search. - **address** (string) - Required - The address of the business. - **officer_names** (array of strings) - Optional - Names of the business officers. - **options** (array of strings) - Optional - An array of order options to enable. Supported options include: - `Order.WebsiteAnalysis`: Discovers and analyzes the business website. - `Order.NaicsPrediction`: Classifies the business industry and returns NAICS, MCC, and SIC codes. - `Order.Enhanced`: Comprehensive search including Website Analysis, Industry Prediction, social media discovery, reviews, and additional addresses/officers. - `Order.Pep`: Checks if any business officers are politically exposed persons. - **tin** (string) - Optional - The Taxpayer Identification Number of the business. ### Request Example ```json { "name": "Howard Concrete Pumping Co Inc", "address": "2327 Hill Church Houston Rd, Canonsburg PA 15317", "officer_names": [ "Frank Howard Jr" ], "options": ["Order.WebsiteAnalysis", "Order.NaicsPrediction"], "tin": "123456789" } ``` ### Response #### Success Response (200) - **id** (string) - Unique identifier for the search request. - **options** (array of strings) - The order options that were applied to the search. - **orderables** (array of objects) - An array containing details and URLs to fetch the results for each enabled orderable. - **type** (string) - The type of the orderable (e.g., `WebsiteAnalysisRequest`, `NAICSPredictionRequest`). - **id** (string) - Unique identifier for the orderable. - **url** (string) - URL to fetch the results for this orderable. - **option** (string) - The specific order option this relates to. - **user** (any) - User associated with the search (can be null). - **state** (string) - The current state of the search (e.g., `COMPLETED`). #### Response Example ```json { "id": "34c6d880-1f95-460b-9ad4-8e7c713764b1", "options": [ "Order.WebsiteAnalysis", "Order.NaicsPrediction" ], "orderables": [ { "type": "WebsiteAnalysisRequest", "id": "ac5aca82-e75e-40d0-a0eb-1fc474cef2c4", "url": "https://api.baselayer.com/website_analysis_requests/ac5aca82-e75e-40d0-a0eb-1fc474cef2c4", "option": "Order.WebsiteAnalysis" }, { "type": "NAICSPredictionRequest", "id": "7f1f1bc6-119d-4613-af28-7f885d37cf2c", "url": "https://api.baselayer.com/naics_prediction_requests/7f1f1bc6-119d-4613-af28-7f885d37cf2c", "option": "Order.NaicsPrediction" } ], "user": null, "state": "COMPLETED" } ``` ### Error Handling - Synchronous requests including `options` will automatically fail. - Sandbox searches require exact input matching; variations can lead to no results. ``` -------------------------------- ### Get Address Details - PHP Example Source: https://docs.baselayer.com/reference/get_address_addresses__address_id__get-1 A PHP example for retrieving address details via the Baselayer API. This code uses cURL functions to make the HTTP GET request. ```php = 200 && $http_code < 300) { return json_decode($response, true); } else { echo "HTTP Error: " . $http_code . "\n"; return null; } } // Example usage: // $address_data = get_address('your_address_id'); // print_r($address_data); ?> ``` -------------------------------- ### Get Address Details - Node.js Example Source: https://docs.baselayer.com/reference/get_address_addresses__address_id__get-1 Example of how to retrieve address details using Node.js. This code snippet utilizes the 'axios' library to make a GET request to the Baselayer API. ```javascript const axios = require('axios'); const getAddress = async (addressId) => { try { const response = await axios.get(`https://api.baselayer.com/addresses/${addressId}`, { headers: { 'accept': 'application/json' } }); return response.data; } catch (error) { console.error('Error fetching address:', error); throw error; } }; // Example usage: // getAddress('your_address_id').then(data => console.log(data)); ``` -------------------------------- ### POST /searches Source: https://docs.baselayer.com/docs/business-search Submit a new business search request. The API returns immediately with a PENDING state and a search ID. ```APIDOC ## POST /searches ### Description Submit a new business search request. The API returns immediately with a `PENDING` state and a search ID. ### Method POST ### Endpoint https://api.baselayer.com/searches ### Parameters #### Header Parameters - **X-API-Key** (string) - Required - Your Baselayer API key. - **Accept** (string) - Optional - `application/json`. - **Content-Type** (string) - Required - `application/json`. #### Request Body - **name** (string) - Required - Legal business name. - **address** (string) - Required - Business address (at minimum: city and state). - **officer_names** (array of strings) - Optional - List of officer names to enable officer match signals. - **website** (string) - Optional - Business website URL to enable website match checks. - **tin** (string) - Optional - Taxpayer Identification Number to enable IRS verification. - **phone_number** (string) - Optional - Business phone number. - **email** (string) - Optional - Business email address. - **reference_id** (string) - Optional - Your internal ID or case number for this request. - **options** (object) - Optional - Request additional features like Website Analysis or Industry Prediction. ### Request Example ```json { "name": "Howard Concrete Pumping Co Inc", "address": "2327 Hill Church Houston Rd, Canonsburg PA 15317", "officer_names": [ "Frank Howard Jr" ], "website": "https://www.howardconcretepumping.com/", "tin": "123456789" } ``` ### Response #### Success Response (200) - **id** (string) - Unique search identifier. - **state** (string) - Current status of the search (e.g., `PENDING`, `EXECUTING`, `COMPLETED`, `FAILED`). - **url** (string) - Endpoint to retrieve full search results. - **status_url** (string) - Endpoint to check the search status. - **console_url** (string) - Direct link to view results in the Baselayer Console. #### Response Example ```json { "id": "e3166643-8578-4fff-aafc-6b5602dfb404", "options": [], "orderables": [], "user": null, "state": "PENDING", "name": "Howard Concrete Pumping Co Inc", "address": "2327 Hill Church Houston Rd, Canonsburg PA 15317", "search_address": null, "officer_names": [ "Frank Howard Jr" ], "website": "https://www.howardconcretepumping.com/", "phone_number": null, "email": null, "tin": "123456789", "reference_id": null, "tin_matched": null, "tin_potential_match": null, "watchlist_hits": [], "business_name_match": null, "business_address_match": null, "business_officer_match": null, "registered_agent_match": null, "business_website_match": null, "search_address_validation_level": null, "created_at": "2025-10-13T23:28:03.844055Z", "updated_at": null, "verified": null, "scores": [], "error": null, "warnings": [], "business": null, "url": "https://api.baselayer.com/searches/e3166643-8578-4fff-aafc-6b5602dfb404", "status_url": "https://api.baselayer.com/searches/e3166643-8578-4fff-aafc-6b5602dfb404/status", "business_url": null, "console_url": "https://console.baselayer.com/search?q=e3166643-8578-4fff-aafc-6b5602dfb404" } ``` ``` -------------------------------- ### Synchronous Business Search Response Example Source: https://docs.baselayer.com/docs/business-search This JSON object represents a successful synchronous business search response from the Baselayer API. It includes details about the search state, match quality, risk scores, and comprehensive business information. ```json { "id": "e3166643-8578-4fff-aafc-6b5602dfb404", "state": "COMPLETED", "verified": true, "business_name_match": "EXACT", "business_address_match": "EXACT", "tin_matched": false, "scores": [ { "type": "kyb", "score": 83.0, "rating": "B" }, { "type": "risk", "score": 93.0, "rating": "A" } ], "business": { "id": "1e78e99d-d515-435a-a0b5-dc7899f55f9c", "name": "HOWARD CONCRETE PUMPING CO., INC.", "structure": "C_CORPORATION", "months_in_business": 377, ... } } ``` -------------------------------- ### Get Portfolio Item Snapshot - PHP Example Source: https://docs.baselayer.com/reference/get_portfolio_item_snapshot_portfolio_items__item_id__snapshots__snapshot_id__get-1 A PHP example for fetching a portfolio item snapshot using cURL. This code snippet demonstrates setting up the cURL request, including the URL and headers, and executing it to get the snapshot data. ```php ``` -------------------------------- ### Get Portfolio Group Response Example Source: https://docs.baselayer.com/reference/get_portfolio_group_portfolio_groups__group_id__get-1 This is an example of a successful JSON response when retrieving a portfolio group. It includes the group's ID, name, item count, and creation/update timestamps. ```JSON { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "string", "items_count": 0, "created_at": "2026-01-21T23:36:36.043Z", "updated_at": "2026-01-21T23:36:36.043Z" } ``` -------------------------------- ### POST /portfolio/items Source: https://docs.baselayer.com/docs/portfolio-monitoring-api-quickstart Adds a verified business search result to your portfolio for ongoing monitoring. This is a crucial step after confirming a business search. ```APIDOC ## POST /portfolio/items ### Description Adds a verified business search result to your portfolio for ongoing monitoring. This is a crucial step after confirming a business search. ### Method POST ### Endpoint /portfolio/items ### Parameters #### Request Body - **business_search_id** (string) - Required - The ID of the business search to add to the portfolio. This should be the `id` field from a previous search response. ### Request Example ```json { "business_search_id": "4dc4fd78-b7de-4ee8-ade0-dbd455e48ca6" } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the newly created portfolio item. - **business_id** (string) - The underlying Baselayer business ID. - **business** (object) - Details of the business, including name, address, incorporation date, etc. - **group_id** (string) - Identifier for the group the portfolio item belongs to (can be null). - **name** (string) - The name of the portfolio item. - **address** (string) - The address associated with the portfolio item. - **business_name_match** (string) - The type of match for the business name (e.g., "EXACT"). - **business_address_match** (string) - The type of match for the business address (e.g., "EXACT"). - **verified** (boolean) - Indicates if the portfolio item has been verified. - **scores** (array) - An array of score objects, including KYB and risk scores at the time of addition. - **created_at** (string) - The timestamp when the portfolio item was created. - **last_monitored_at** (string) - The timestamp of the last monitoring activity (can be null). #### Response Example ```json { "id": "825667a6-2fe0-432d-ae59-edddab3ce068", "business_id": "428ee4cc-39c0-4f8f-981a-95dbe5f8bbe3", "business": { "id": "428ee4cc-39c0-4f8f-981a-95dbe5f8bbe3", "name": "22645 Anza Avenue Statutory Trust", "address": "1716 Capitol Ave Cheyenne WY 82001", "incorporation_date": "2021-01-01", "structure": "TRUST", "ein": null, "incorporation_state": "WY", "phone_number": null, "email": null, "website": null, "url": "https://api.staging.baselayer.com/businesses/428ee4cc-39c0-4f8f-981a-95dbe5f8bbe3", "console_url": "https://console.staging.baselayer.com/business/428ee4cc-39c0-4f8f-981a-95dbe5f8bbe3" }, "group_id": null, "name": "22645 anza avenue statutory trust", "address": "1718 capitol avenue cheyenne wy 82001", "business_name_match": "EXACT", "business_address_match": "EXACT", "verified": true, "scores": [ { "type": "kyb", "score": 100, "rating": "A" }, { "type": "risk", "score": 100, "rating": "A" } ], "created_at": "2025-11-26T20:27:41.824138Z", "last_monitored_at": null } ``` ``` -------------------------------- ### Receive Initial Search Response (JSON) Source: https://docs.baselayer.com/docs/business-search The API returns an immediate JSON response upon successful submission of a business search request. This response includes a unique search ID, the current state (PENDING), and URLs to retrieve the full results or check the status. ```json { "id": "e3166643-8578-4fff-aafc-6b5602dfb404", "options": [], "orderables": [], "user": null, "state": "PENDING", "name": "Howard Concrete Pumping Co Inc", "address": "2327 Hill Church Houston Rd, Canonsburg PA 15317", "search_address": null, "officer_names": [ "Frank Howard Jr" ], "website": "https://www.howardconcretepumping.com/", "phone_number": null, "email": null, "tin": "123456789", "reference_id": null, "tin_matched": null, "tin_potential_match": null, "watchlist_hits": [], "business_name_match": null, "business_address_match": null, "business_officer_match": null, "registered_agent_match": null, "business_website_match": null, "search_address_validation_level": null, "created_at": "2025-10-13T23:28:03.844055Z", "updated_at": null, "verified": null, "scores": [], "error": null, "warnings": [], "business": null, "url": "https://api.baselayer.com/searches/e3166643-8578-4fff-aafc-6b5602dfb404", "status_url": "https://api.baselayer.com/searches/e3166643-8578-4fff-aafc-6b5602dfb404/status", "business_url": null, "console_url": "https://console.baselayer.com/search?q=e3166643-8578-4fff-aafc-6b5602dfb404" } ``` -------------------------------- ### Get Lien Submission Attachments - Response Example Source: https://docs.baselayer.com/reference/get_lien_submission_attachments_lien_submissions__filing_id__attachments_get-1 This is an example of a successful JSON response (200 OK) when retrieving lien submission attachments. It returns an array of attachment objects, each containing an 'id' and 'document_filename'. ```json [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "document_filename": "lien_document.pdf" } ] ``` -------------------------------- ### Fetch Portfolio Updates (HTTP) Source: https://docs.baselayer.com/docs/portfolio-monitoring-api-quickstart This snippet shows how to retrieve updates for items in your portfolio. The GET request to '/portfolio/updates' can be optionally filtered by 'limit' and 'cursor' for pagination. Updates include changes in registration standing, scores, addresses, officers, and watchlist status. ```http GET /portfolio/updates?limit=10&cursor=some_cursor_value ``` -------------------------------- ### Get Notification Policies Response Example (JSON) Source: https://docs.baselayer.com/reference/get_notification_policies_notification_policies_get-1 An example JSON response for the 'Get Notification Policies' API endpoint. It illustrates the structure of a single notification policy object, including its ID, scope, name, and other relevant details. ```json [ { "id": "ede786f3-33ae-4894-843d-af2025f1d5b0", "scope": "portfolio", "name": "string", "item_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "group_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "enabled": true, "cadence": "daily", "last_run_at": "2026-01-21T23:36:27.686Z", "next_run_on": "2026-01-21T23:36:27.686Z", "attributes": [ "new_registrations" ], "url": "string", "group_url": "string", "item_url": "string" } ] ``` -------------------------------- ### Company Information Source: https://docs.baselayer.com/docs/business-search Retrieves general information about the company associated with the project. ```APIDOC ## GET /company ### Description Retrieves general information about the company associated with the project, including website and incorporation details. ### Method GET ### Endpoint `/company` ### Response #### Success Response (200) - **website** (string) - The company's website URL. - **incorporation_state** (string) - The state where the company was incorporated. - **incorporation_date** (string) - The date of incorporation in YYYY-MM-DD format. #### Response Example { "website": "https://www.howardconcretepumping.com/", "incorporation_state": "PA", "incorporation_date": "1994-05-25" } ``` -------------------------------- ### Get Search Results Source: https://docs.baselayer.com/docs/getting-started Retrieve the status and results of a business search. This can be done by polling the API endpoint. ```APIDOC ## GET /searches/{search_id} ### Description Polls the status and retrieves the results of a previously initiated business search. ### Method GET ### Endpoint /searches/{search_id} ### Parameters #### Path Parameters - **search_id** (string) - Required - The unique identifier for the search. #### Query Parameters None #### Request Body None ### Request Example ```bash curl --request GET \ --url https://api.baselayer.com/searches/a1b2c3d4-5678-90ab-cdef-1234567890ab \ --header 'X-API-Key: your_api_key_here' ``` ### Response #### Success Response (200) - **id** (string) - The search ID. - **state** (string) - The current state of the search (e.g., "COMPLETED"). - **business** (object) - The complete business profile if the search is completed. - **id** (string) - The unique identifier for the business. - **name** (string) - The name of the business. - **registration** (object) - Business registration details. - **officers** (array) - List of business officers. - **addresses** (array) - List of business addresses. - **scores** (array) - Risk scores associated with the business. #### Response Example ```json { "__event__": { "type": "BusinessSearch.completed" }, "id": "a1b2c3d4-5678-90ab-cdef-1234567890ab", "state": "COMPLETED", "business": { "id": "b9c8d7e6-1234-5678-90ab-fedcba098765", "name": "Baselayer Technologies Inc", "registration": { ... }, "officers": [ ... ], "addresses": [ ... ], "scores": [ ... ] } } ``` ``` -------------------------------- ### Business Search API Source: https://docs.baselayer.com/docs/portfolio-monitoring-api-quickstart Use the Business Search endpoint to look up and verify a business by name and address. This is a synchronous search. ```APIDOC ## POST /searches ### Description Searches for a business by name and address. ### Method POST ### Endpoint /searches ### Parameters #### Query Parameters None #### Request Body - **name** (string) - Required - The name of the business to search for. - **address** (string) - Required - The address of the business to search for. ### Request Example ```json { "name": "22645 anza avenue statutory trust", "address": "1718 capitol avenue cheyenne wy 82001" } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the search. - **state** (string) - The current state of the search (e.g., COMPLETED). - **name** (string) - The name of the business found. - **address** (string) - The address of the business found. - **search_address** (object) - Details about the searched address. - **business_name_match** (string) - The type of match for the business name (e.g., EXACT). - **business_address_match** (string) - The type of match for the business address (e.g., EXACT). - **scores** (array) - An array of score objects for the business. - **business** (object) - Detailed information about the business. - **url** (string) - The URL for the search result. - **status_url** (string) - The URL to check the status of the search. - **business_url** (string) - The URL for the business details. - **console_url** (string) - The URL to view the business in the console. #### Response Example ```json { "id": "4dc4fd78-b7de-4ee8-ade0-dbd455e48ca6", "state": "COMPLETED", "name": "22645 anza avenue statutory trust", "address": "1718 capitol avenue cheyenne wy 82001", "search_address": { "id": "587c35d9-7ec4-48bb-a421-7b20c4db005c", "street": "1716 Capitol Ave Ste 100", "city": "Cheyenne", "state": "WY", "zip": "82001", "latitude": 41.13403, "longitude": -104.81626, "rdi": "Commercial", "deliverable": true, "cmra": false, "url": "https://api.staging.baselayer.com/addresses/587c35d9-7ec4-48bb-a421-7b20c4db005c", "delivery_type": "STREET" }, "business_name_match": "EXACT", "business_address_match": "EXACT", "scores": [ { "type": "kyb", "score": 100.0, "rating": "A" }, { "type": "risk", "score": 100.0, "rating": "A" } ], "business": { "id": "428ee4cc-39c0-4f8f-981a-95dbe5f8bbe3", "name": "22645 Anza Avenue Statutory Trust", "structure": "TRUST", "addresses": [ { "id": "96ab5659-0a69-415e-a5f7-76e992ae7bd0", "street": "1718 Capitol Ave", "city": "Cheyenne", "state": "WY", "zip": "82001" }, { "id": "587c35d9-7ec4-48bb-a421-7b20c4db005c", "street": "1716 Capitol Ave Ste 100", "city": "Cheyenne", "state": "WY", "zip": "82001" } ], "incorporation_state": "WY", "incorporation_date": "2021-01-01", "months_in_business": 58, "registrations": [], "business_officers": [], "watchlist_hits": [ { "code": "IEO", "name": "IRS Exempt Organizations List", "count": 0, "details": [] } ], "url": "https://api.staging.baselayer.com/businesses/428ee4cc-39c0-4f8f-981a-95dbe5f8bbe3", "console_url": "https://console.staging.baselayer.com/business/428ee4cc-39c0-4f8f-981a-95dbe5f8bbe3", "address": "1716 Capitol Ave Ste 100, Cheyenne, WY 82001" }, "url": "https://api.staging.baselayer.com/searches/4dc4fd78-b7de-4ee8-ade0-dbd455e48ca6", "status_url": "https://api.staging.baselayer.com/searches/4dc4fd78-b7de-4ee8-ade0-dbd455e48ca6/status", "business_url": "https://api.staging.baselayer.com/businesses/428ee4cc-39c0-4f8f-981a-95dbe5f8bbe3", "console_url": "https://console.staging.baselayer.com/business/428ee4cc-39c0-4f8f-981a-95dbe5f8bbe3?searchId=4dc4fd78-b7de-4ee8-ade0-dbd455e48ca6" } ``` ``` -------------------------------- ### Get Searches API Request (Python) Source: https://docs.baselayer.com/reference Example of how to make a GET request to the Get Searches API endpoint using Python. This snippet uses the 'requests' library for HTTP requests and shows how to include query parameters for filtering and pagination. ```python import requests url = "https://api.baselayer.com/searches" params = { "q": "search_name_or_id", "limit": "10", "offset": "0", "cursor": "cursor_token", "start_date": "YYYY-MM-DD", "end_date": "YYYY-MM-DD", "tz": "UTC" } headers = { "accept": "application/json" } response = requests.get(url, params=params, headers=headers) print(response.json()) ``` -------------------------------- ### Fetching Orderable Results Source: https://docs.baselayer.com/docs/business-search After initiating a search with order options, you can fetch the results for each orderable by making GET requests to the provided URLs. Alternatively, you can listen for webhook events. ```APIDOC ## Fetching Orderable Results ### Description Retrieve the detailed results for specific order options (e.g., Website Analysis, NAICS Prediction) by making GET requests to the URLs provided in the `orderables` array of the initial search response. Webhook events can also be used to receive notifications when results are ready. ### Method GET ### Endpoint `/website_analysis_requests/{id}` `/naics_prediction_requests/{id}` (and other endpoints corresponding to the `type` in the `orderables` array) ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the specific orderable request to fetch. #### Query Parameters None ### Request Example ```bash curl --request GET \ --url https://api.baselayer.com/website_analysis_requests/ac5aca82-e75e-40d0-a0eb-1fc474cef2c4 \ --header 'X-API-Key: ' ``` ### Response #### Success Response (200) - The structure of the success response will vary depending on the `type` of the orderable. It will contain the specific data analyzed for that option (e.g., website details, NAICS codes, PEP information). #### Response Example (Website Analysis) ```json { "id": "ac5aca82-e75e-40d0-a0eb-1fc474cef2c4", "domain_age": 10, "registrar": "GoDaddy.com, LLC", "is_parked": false, "contact_email": "info@example.com", "website": "https://example.com", "status": "COMPLETED" } ``` ### Webhooks Listen for events such as `WebsiteAnalysisRequest.Completed` and `NAICSPredictionRequest.Completed` for asynchronous notifications. ```