### People URL Finder Implementation Examples Source: https://docs.airscale.io/api-reference/people-url-finder Client-side implementation examples for the search endpoint. ```curl curl -X POST https://api.airscale.io/v1/url-search-people \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "first_name": "Victor", "last_name": "Detraz", "company_name": "Airscale" }' ``` ```python import requests import json url = 'https://api.airscale.io/v1/url-search-people' api_key = 'YOUR_API_KEY' headers = { 'Authorization': f'Bearer {api_key}', 'Content-Type': 'application/json' } data = { 'first_name': 'Victor', 'last_name': 'Detraz', 'company_name': 'Airscale' } response = requests.post(url, headers=headers, json=data) print(response.status_code) print(response.json()) ``` ```javascript const fetch = require('node-fetch'); const url = 'https://api.airscale.io/v1/url-search-people'; const apiKey = 'YOUR_API_KEY'; const data = { first_name: 'Victor', last_name: 'Detraz', company_name: 'Airscale' }; fetch(url, { method: 'POST', headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' }, body: JSON.stringify(data) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` ```php < ``` ```go package main return } req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData)) if err != nil { fmt.Println("Error creating request:", err) return } req.Header.Set("Authorization", "Bearer "+apiKey) req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { fmt.Println("Error making request:", err) return } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { fmt.Println("Error reading response:", err) return } fmt.Println("Status:", resp.Status) fmt.Println("Response:", string(body)) } ``` -------------------------------- ### Go Implementation Source: https://docs.airscale.io/api-reference/personal-email Example usage of the endpoint using the net/http package. ```go package main import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://api.airscale.io/v1/personal-email" payload := map[string]string{ "linkedin_profile_url": "https://www.linkedin.com/in/vdetraz", } jsonPayload, _ := json.Marshal(payload) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonPayload)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Bulk Email Finder Implementation Examples Source: https://docs.airscale.io/api-reference/email-finder-%28bulk%29 Code examples for interacting with the bulk email finder endpoint across various programming languages. ```curl curl -X POST "https://api.airscale.io/v1/email-bulk" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "webhook_url": "https://your-site.com/webhook", "inputs": [ { "custom_id": "contact_001", "first_name": "Victor", "last_name": "Detraz", "domain": "airscale.io", "company_name": "Airscale", "linkedin_profile_url": "https://www.linkedin.com/in/vdetraz/" } ] }' ``` ```python import requests response = requests.post( "https://api.airscale.io/v1/email-bulk", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" }, json={ "webhook_url": "https://your-site.com/webhook", "inputs": [ { "custom_id": "contact_001", "first_name": "Victor", "last_name": "Detraz", "domain": "airscale.io", "company_name": "Airscale", "linkedin_profile_url": "https://www.linkedin.com/in/vdetraz/" } ] } ) print(response.status_code, response.json()) ``` ```javascript fetch("https://api.airscale.io/v1/email-bulk", { method: "POST", headers: { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" }, body: JSON.stringify({ webhook_url: "https://your-site.com/webhook", inputs: [ { custom_id: "contact_001", first_name: "Victor", last_name: "Detraz", domain: "airscale.io", company_name: "Airscale", linkedin_profile_url: "https://www.linkedin.com/in/vdetraz/" } ] }) }) .then(res => res.json()) .then(data => console.log(data)) .catch(err => console.error("Error:", err)); ``` ```php true, CURLOPT_POST => true, CURLOPT_HTTPHEADER => [ "Authorization: Bearer YOUR_API_KEY", "Content-Type: application/json" ], CURLOPT_POSTFIELDS => json_encode([ "webhook_url" => "https://your-site.com/webhook", "inputs" => [ [ "custom_id" => "contact_001", "first_name" => "Victor", "last_name" => "Detraz", "domain" => "airscale.io", "company_name" => "Airscale", "linkedin_profile_url" => "https://www.linkedin.com/in/vdetraz/" ] ] ]) ]); echo curl_exec($ch); curl_close($ch); ``` ```go package main "net/http" ) func main() { payload, _ := json.Marshal(map[string]interface{}{ "webhook_url": "https://your-site.com/webhook", "inputs": []map[string]string{ { "custom_id": "contact_001", "first_name": "Victor", "last_name": "Detraz", "domain": "airscale.io", "company_name": "Airscale", "linkedin_profile_url": "https://www.linkedin.com/in/vdetraz/", }, }, }) req, _ := http.NewRequest("POST", "https://api.airscale.io/v1/email-bulk", bytes.NewBuffer(payload)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, err := (&http.Client{}).Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Python Request Example Source: https://docs.airscale.io/api-reference/airsearch Example of calling the Airsearch endpoint using the requests library. ```python import requests response = requests.post( "https://api.airscale.io/v1/airsearch", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" }, json={ "prompt": "What is the funding raised by Mistral AI and who are their investors?", "schema": { "total_funding": "Total funding raised in USD", "latest_round": "string", "investors": "Comma-separated list of investors" } } ) print(response.status_code, response.json()) ``` -------------------------------- ### Example Usage: Go Source: https://docs.airscale.io/api-reference/mobile-finder How to call the Mobile Finder API using Go. Remember to replace YOUR_API_KEY with your actual API key. ```go package main import ( "bytes" "encoding/json" "fmt" "net/http" "io/ioutil" ) func main() { url := "https://api.airscale.io/v1/phone" payload := map[string]string{ "linkedin_profile_url": "https://www.linkedin.com/in/vdetraz", } body, _ := json.Marshal(payload) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { fmt.Println("Request error:", err) return } defer resp.Body.Close() respBody, _ := ioutil.ReadAll(resp.Body) fmt.Println("Status:", resp.Status) fmt.Println("Body:", string(respBody)) } ``` -------------------------------- ### cURL Implementation Source: https://docs.airscale.io/api-reference/personal-email Example usage of the endpoint using the cURL command-line tool. ```bash curl -X POST https://api.airscale.io/v1/personal-email \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"linkedin_profile_url": "https://www.linkedin.com/in/vdetraz"}' ``` -------------------------------- ### Email Finder Implementation Examples Source: https://docs.airscale.io/api-reference/email-finder Code examples for integrating the Email Finder API across various programming languages. ```curl curl -X POST "https://api.airscale.io/v1/email" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "linkedin_profile_url": "https://www.linkedin.com/in/vdetraz/", "first_name": "Victor", "last_name": "Detraz", "domain": "airscale.io", "company_name": "Airscale" }' ``` ```python import requests url = "https://api.airscale.io/v1/email" headers = { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" } data = { "first_name": "Victor", "last_name": "Detraz", "domain": "airscale.io", "company_name": "Airscale" } response = requests.post(url, json=data, headers=headers) print(response.status_code) print(response.json()) ``` ```javascript fetch("https://api.airscale.io/v1/email", { method: "POST", headers: { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" }, body: JSON.stringify({ first_name: "Victor", last_name: "Detraz", domain: "airscale.io", company_name: "Airscale" }) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```php "Victor", "last_name" => "Detraz", "domain" => "airscale.io", "company_name" => "Airscale" ]; curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ "Authorization: Bearer YOUR_API_KEY", "Content-Type: application/json" ]); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); $response = curl_exec($ch); curl_close($ch); echo $response; ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://api.airscale.io/v1/email" payload := map[string]string{ "first_name": "Victor", "last_name": "Detraz", "domain": "airscale.io", "company_name": "Airscale", } body, _ := json.Marshal(payload) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() respBody, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(respBody)) } ``` -------------------------------- ### cURL Request Example Source: https://docs.airscale.io/api-reference/airsearch Example of calling the Airsearch endpoint using cURL. ```bash curl -X POST "https://api.airscale.io/v1/airsearch" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "What is the funding raised by Mistral AI and who are their investors?", "schema": { "total_funding": "Total funding raised in USD", "latest_round": "string", "investors": "Comma-separated list of investors" } }' ``` -------------------------------- ### JavaScript Fetch Example Source: https://docs.airscale.io/api-reference/airsearch Example of calling the Airsearch endpoint using the browser Fetch API. ```javascript fetch("https://api.airscale.io/v1/airsearch", { method: "POST", headers: { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" }, body: JSON.stringify({ prompt: "What is the funding raised by Mistral AI and who are their investors?", schema: { total_funding: "Total funding raised in USD", latest_round: "string", investors: "Comma-separated list of investors" } }) }) .then(res => res.json()) .then(data => console.log(data)) .catch(err => console.error("Error:", err)); ``` -------------------------------- ### Not Found Response Example Source: https://docs.airscale.io/api-reference/airsearch Returned when the agent cannot locate relevant information for the provided prompt. ```json { "status": "not_found", "response": "No relevant information found.", "confidence_score": 0.1, "certainty_tag": "low", "sources": [], "duration_ms": 6103 } ``` -------------------------------- ### Example Usage: JavaScript (Fetch) Source: https://docs.airscale.io/api-reference/mobile-finder How to call the Mobile Finder API using the Fetch API in JavaScript. Replace YOUR_API_KEY with your actual API key. ```javascript fetch("https://api.airscale.io/v1/phone", { method: "POST", headers: { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" }, body: JSON.stringify({ linkedin_profile_url: "https://www.linkedin.com/in/vdetraz" }) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` -------------------------------- ### PHP Implementation Source: https://docs.airscale.io/api-reference/personal-email Example usage of the endpoint using PHP's cURL extension. ```php 'https://www.linkedin.com/in/vdetraz' ]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response; ?> ``` -------------------------------- ### Example Usage: cURL Source: https://docs.airscale.io/api-reference/mobile-finder How to call the Mobile Finder API using cURL. Ensure you replace YOUR_API_KEY with your actual API key. ```bash curl -X POST "https://api.airscale.io/v1/phone" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "linkedin_profile_url": "https://www.linkedin.com/in/vdetraz" }' ``` -------------------------------- ### Example Usage: PHP Source: https://docs.airscale.io/api-reference/mobile-finder How to call the Mobile Finder API using PHP cURL. Ensure you replace YOUR_API_KEY with your actual API key. ```php "https://www.linkedin.com/in/vdetraz" ]; $headers = [ "Authorization: Bearer YOUR_API_KEY", "Content-Type: application/json" ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); curl_close($ch); echo $response; ?> ``` -------------------------------- ### Example Usage: Python Source: https://docs.airscale.io/api-reference/mobile-finder How to call the Mobile Finder API using Python's requests library. Remember to replace YOUR_API_KEY with your actual API key. ```python import requests url = "https://api.airscale.io/v1/phone" headers = { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" } data = { "linkedin_profile_url": "https://www.linkedin.com/in/vdetraz" } response = requests.post(url, json=data, headers=headers) print(response.status_code) print(response.json()) ``` -------------------------------- ### Python Implementation Source: https://docs.airscale.io/api-reference/personal-email Example usage of the endpoint using the requests library. ```python import requests url = "https://api.airscale.io/v1/personal-email" headers = { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" } payload = { "linkedin_profile_url": "https://www.linkedin.com/in/vdetraz" } response = requests.post(url, headers=headers, json=payload) print(response.json()) ``` -------------------------------- ### PHP Request Example Source: https://docs.airscale.io/api-reference/airsearch Example of calling the Airsearch endpoint using PHP cURL. ```php true, CURLOPT_POST => true, CURLOPT_HTTPHEADER => [ "Authorization: Bearer YOUR_API_KEY", "Content-Type: application/json" ], CURLOPT_POSTFIELDS => json_encode([ "prompt" => "What is the funding raised by Mistral AI and who are their investors?", "schema" => [ "total_funding" => "Total funding raised in USD", "latest_round" => "string", "investors" => "Comma-separated list of investors" ] ]) ]); echo curl_exec($ch); curl_close($ch); ``` -------------------------------- ### cURL - Count People Source: https://docs.airscale.io/api-reference/find-people Example using cURL to send a POST request to the /v1/find-people/count endpoint to get the total number of people matching the query. Replace `YOUR_API_KEY` with your actual API key. ```bash curl -X POST "https://api.airscale.io/v1/find-people/count" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "query": { "JobTitle": { "include": ["CEO", "Founder"] }, "location": { "include": ["FR"] } } }' ``` -------------------------------- ### Reverse Email Example Usage Source: https://docs.airscale.io/api-reference/reverse-email Implementation examples for the reverse email lookup across various programming languages. ```curl curl -X POST https://api.airscale.io/v1/reverse-email \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"email": "victor@airscale.io"}' ``` ```python import requests url = 'https://api.airscale.io/v1/reverse-email' headers = { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' } payload = { 'email': 'victor@airscale.io' } response = requests.post(url, headers=headers, json=payload) data = response.json() print(data) ``` ```javascript const response = await fetch('https://api.airscale.io/v1/reverse-email', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ email: 'victor@airscale.io' }) }); const data = await response.json(); console.log(data); ``` ```php $email]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'Authorization: Bearer ' . $apiKey ]); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($response === false) { ``` ```go package main req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData)) if err != nil { return fmt.Errorf("error creating request: %w", err) } req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { return fmt.Errorf("error making request: %w", err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return fmt.Errorf("error reading response: %w", err) } fmt.Printf("Status: %d\n", resp.StatusCode) fmt.Printf("Response: %s\n", string(body)) return nil } func main() { err := reverseEmailLookup("victor@airscale.io") if err != nil { fmt.Printf("Error: %v\n", err) } } ``` -------------------------------- ### Python Example for Reverse Phone Lookup Source: https://docs.airscale.io/api-reference/reverse-phone This Python script uses the 'requests' library to perform a reverse phone lookup. Ensure you have the library installed (`pip install requests`). ```python import requests url = 'https://api.airscale.io/v1/reverse-phone' headers = { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' } payload = { 'mobile_phone': '+13178402714' } response = requests.post(url, headers=headers, json=payload) data = response.json() print(data) ``` -------------------------------- ### JavaScript Fetch Implementation Source: https://docs.airscale.io/api-reference/personal-email Example usage of the endpoint using the native Fetch API. ```javascript const url = 'https://api.airscale.io/v1/personal-email'; const headers = { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }; const payload = { linkedin_profile_url: 'https://www.linkedin.com/in/vdetraz' }; fetch(url, { method: 'POST', headers: headers, body: JSON.stringify(payload) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### JavaScript Fetch Example for Reverse Phone Lookup Source: https://docs.airscale.io/api-reference/reverse-phone This JavaScript example uses the Fetch API to call the reverse phone endpoint. It's suitable for browser-based or Node.js environments. ```javascript const response = await fetch('https://api.airscale.io/v1/reverse-phone', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ mobile_phone: '+13178402714' }) }); const data = await response.json(); console.log(data); ``` -------------------------------- ### Company Profile Extraction Implementation Source: https://docs.airscale.io/api-reference/extract-company-profile Example implementations for interacting with the company profile API. ```curl curl -X POST "https://api.airscale.io/v1/company" \ -H "Authorization: Bearer YOUR_USER_API_KEY" \ -H "Content-Type: application/json" \ -d '{"linkedin_profile_url":"https://linkedin.com/company/airscale-io"}' ``` ```python import requests url = "https://api.airscale.io/v1/company" headers = { "Authorization": "Bearer YOUR_USER_API_KEY", "Content-Type": "application/json", } json_body = { "linkedin_profile_url": "https://linkedin.com/company/airscale-io", # "webhook_url": "https://your.app/receiveProfile", # optional } resp = requests.post(url, headers=headers, json=json_body, timeout=60) print(resp.status_code, resp.text) ``` ```javascript // Node 18+ has global fetch const url = "https://api.airscale.io/v1/company"; async function run() { const res = await fetch(url, { method: "POST", headers: { "Authorization": "Bearer YOUR_USER_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ linkedin_profile_url:"https://linkedin.com/company/airscale-io", // webhook_url: "https://your.app/receiveProfile", // optional }), }); const text = await res.text(); console.log(res.status, text); } run().catch(console.error); ``` ```php "https://linkedin.com/company/airscale-io" ]; $ch = curl_init($apiUrl); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . $userApiKey, "Content-Type: application/json" ], CURLOPT_POSTFIELDS => json_encode($payload), CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 60 ]); $response = curl_exec($ch); if ($response === false) { die("cURL Error: " . curl_error($ch)); } ``` ```go package main import ( "bytes" "fmt" "io" "net/http" "time" ) func main() { body := []byte(`{"linkedin_profile_url":"https://linkedin.com/company/airscale-io"}`) req, _ := http.NewRequest("POST", "https://api.airscale.io/v1/company", bytes.NewBuffer(body)) req.Header.Set("Authorization", "Bearer YOUR_USER_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{Timeout: 60 * time.Second} res, err := client.Do(req) if err != nil { panic(err) } defer res.Body.Close() b, _ := io.ReadAll(res.Body) fmt.Println(res.Status, string(b)) } ``` -------------------------------- ### Extract Profile via cURL Source: https://docs.airscale.io/api-reference/extract-people-profile Example command to perform the POST request using cURL. ```bash curl -X POST "https://api.airscale.io/v1/profile" \ -H "Authorization: Bearer YOUR_USER_API_KEY" \ -H "Content-Type: application/json" \ -d '{"linkedin_profile_url":"https://linkedin.com/in/vdetraz"}' ``` -------------------------------- ### Go Example for Reverse Phone Lookup Source: https://docs.airscale.io/api-reference/reverse-phone This Go code snippet shows how to perform a reverse phone lookup using the standard `net/http` package. It includes error handling for request creation, execution, and response reading. ```go package main req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData)) if err != nil { return fmt.Errorf("error creating request: %w", err) } req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { return fmt.Errorf("error making request: %w", err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return fmt.Errorf("error reading response: %w", err) } fmt.Printf("Status: %d\n", resp.StatusCode) fmt.Printf("Response: %s\n", string(body)) return nil } func main() { err := reversePhoneLookup("+13178402714") if err != nil { fmt.Printf("Error: %v\n", err) } } ``` -------------------------------- ### Bulk Email Finder Response Formats Source: https://docs.airscale.io/api-reference/email-finder-%28bulk%29 Examples of the immediate response and the asynchronous webhook payloads. ```json { "status": "accepted", "count": 2 } ``` ```json { "custom_id": "contact_001", "status": "success", "email": "john.smith@acme.com", "email_status": "valid", "provider": "Prospeo", "verifier": "Bounceban" } ``` ```json { "custom_id": "contact_002", "status": "not_found", "email": null } ``` -------------------------------- ### cURL Example for Reverse Phone Lookup Source: https://docs.airscale.io/api-reference/reverse-phone This cURL command demonstrates how to call the reverse phone endpoint. Remember to replace 'YOUR_API_KEY' with your actual API key. ```bash curl -X POST https://api.airscale.io/v1/reverse-phone \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"mobile_phone": "+13178402714"}' ``` -------------------------------- ### Find People Response Example (200 OK) Source: https://docs.airscale.io/api-reference/find-people This is a successful response for the /v1/find-people endpoint. It includes the total number of matching people, a list of leads with their profile details, and a cursor for pagination. The `next_cursor` will be null if there are no more pages. ```json { "total": 101, "leads": [ { "firstname": "Victor", "lastname": "Detraz", "headline": "Founder @Airscale", "description": "...", "profileUrl": "https://www.linkedin.com/in/vdetraz", "lastJobTitle": "Founder", "lastJobStartDate": "03-2024", "address": "Paris, Île-de-France, France", "lastCompanyName": "Airscale", "lastCompanyUrl": "https://www.linkedin.com/company/airscale-io/", "lastCompanyWebsite": "https://airscale.io", "lastCompanySize": 4, "lastCompanyIndustry": "Technology, Information and Internet", "lastCompanyAddress": "75009, Paris, France" } ], "next_cursor": "eyJzYSI6W1syXV..." } ``` -------------------------------- ### JavaScript (Fetch) - Search People Source: https://docs.airscale.io/api-reference/find-people This JavaScript example shows how to use the Fetch API to search for people via the /v1/find-people endpoint. It configures the POST request with appropriate headers and a JSON body. Replace `YOUR_API_KEY` with your actual key. ```javascript fetch("https://api.airscale.io/v1/find-people", { method: "POST", headers: { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" }, body: JSON.stringify({ query: { JobTitle: { include: ["CEO", "Founder"] }, companyDomain: { include: ["airscale.io"] }, location: { include: ["FR"] } }, size: 50 }) }) .then(res => res.json()) .then(data => console.log(data)) .catch(err => console.error("Error:", err)); ``` -------------------------------- ### Check Credit Count with JavaScript (Fetch) Source: https://docs.airscale.io/api-reference/credit-count This JavaScript example uses the fetch API to call the credits endpoint. It handles the response and logs any errors. ```javascript const fetch = require('node-fetch'); const url = "https://api.airscale.io/v1/credits"; fetch(url, { method: "POST", headers: { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" }, body: JSON.stringify({}) }) .then(res => res.text()) .then(text => console.log(text)) .catch(err => console.error(err)); ``` -------------------------------- ### Successful Response Example Source: https://docs.airscale.io/api-reference/airsearch A successful response returns the status, the primary answer, and the extracted fields based on the provided schema. ```json { "status": "success", "response": "The CEO of Airscale is Victor Detraz.", "name": "Victor Detraz", "linkedin_url": "https://www.linkedin.com/in/vdetraz", "email": null, "company": "Airscale", "founded_year": "2024", "confidence_score": 0.92, "certainty_tag": "high", "sources": [ "https://www.linkedin.com/in/vdetraz", "https://airscale.io" ], "reasoning": "LinkedIn profile confirmed identity and current role. Company website corroborated.", "duration_ms": 8412 } ``` -------------------------------- ### cURL - Search People Source: https://docs.airscale.io/api-reference/find-people Example using cURL to send a POST request to the /v1/find-people endpoint with specific search criteria. Ensure to replace `YOUR_API_KEY` with your actual API key. ```bash curl -X POST "https://api.airscale.io/v1/find-people" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "query": { "JobTitle": { "include": ["CEO", "Founder"] }, "companyDomain": { "include": ["airscale.io"] }, "location": { "include": ["FR"] } }, "size": 50 }' ``` -------------------------------- ### Find People Count Response Example (200 OK) Source: https://docs.airscale.io/api-reference/find-people This is a successful response for the /v1/find-people/count endpoint, returning the total number of people matching the specified query. ```json { "total": 101 } ``` -------------------------------- ### Successful Response for Mobile Finder Source: https://docs.airscale.io/api-reference/mobile-finder This is an example of a successful response when the Mobile Finder endpoint is used. It includes the status, the original URL, the found phone number, and the provider. ```json { "status": "success", "linkedin_profile_url": "https://www.linkedin.com/in/vdetraz", "phone_numbers": "+33610607076", "provider": "RocketReach" } ``` -------------------------------- ### PHP Example for Reverse Phone Lookup Source: https://docs.airscale.io/api-reference/reverse-phone This PHP function demonstrates how to make a reverse phone lookup request using cURL. It handles setting headers, the request body, and retrieving the response. ```php $mobile_phone]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'Authorization: Bearer ' . $apiKey ]); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($response === false) { ``` -------------------------------- ### Reverse Phone API Request Body Source: https://docs.airscale.io/api-reference/reverse-phone The request body should contain the mobile phone number for which to find profile information. The email field in the example seems to be a typo and should be 'mobile_phone'. ```json { "email": "+33610607076" } ``` -------------------------------- ### Find People Request Body Example Source: https://docs.airscale.io/api-reference/find-people This JSON object defines the query parameters for searching people. It supports include/exclude filters for various fields like name, job title, company, and location. Maximum 200 values per array are allowed for each filter. ```json { "query": { "firstname": { "include": ["John"], "exclude": ["Johnny"] }, "lastname": { "include": ["Doe"] }, "JobTitle": { "include": ["CEO", "Founder"], "exclude": ["Intern"] }, "companyDomain": { "include": ["airscale.io"] }, "companyLinkedinUrl": { "include": ["https://linkedin.com/company/airscale-io"] }, "location": { "include": ["FR", "US"], "exclude": ["DE"] }, "keyword": { "include": ["B2B"] } }, "size": 50, "cursor": "" } ``` -------------------------------- ### Check Credit Count with Go Source: https://docs.airscale.io/api-reference/credit-count This Go program demonstrates how to make an HTTP POST request to the credits endpoint, including setting headers and handling the response. ```go package main import ( "bytes" "fmt" "net/http" "io/ioutil" ) func main() { url := "https://api.airscale.io/v1/credits" req, _ := http.NewRequest("POST", url, bytes.NewBuffer([]byte(`{}`))) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(resp.Status, string(body)) } ``` -------------------------------- ### Extract Profile via Go Source: https://docs.airscale.io/api-reference/extract-people-profile Implementation using the standard net/http library. ```go package main import ( "bytes" "fmt" "io" "net/http" "time" ) func main() { body := []byte(`{"linkedin_profile_url":"https://linkedin.com/in/vdetraz"}`) req, _ := http.NewRequest("POST", "https://api.airscale.io/v1/profile", bytes.NewBuffer(body)) req.Header.Set("Authorization", "Bearer YOUR_USER_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{Timeout: 60 * time.Second} res, err := client.Do(req) if err != nil { panic(err) } defer res.Body.Close() b, _ := io.ReadAll(res.Body) fmt.Println(res.Status, string(b)) } ``` -------------------------------- ### Check Credit Count Source: https://docs.airscale.io/api-reference/credit-count Use this POST endpoint to retrieve the number of credits available in your workspace. Ensure you include the Authorization and Content-Type headers. ```bash curl -X POST "https://api.airscale.io/v1/credits" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` -------------------------------- ### Search People with Go Source: https://docs.airscale.io/api-reference/find-people This Go code snippet demonstrates how to search for people using the Airscale API. It includes setting up the HTTP request, headers, and JSON payload. Replace YOUR_API_KEY with your valid API key. ```go package main import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { payload, _ := json.Marshal(map[string]interface{}{ "query": map[string]interface{}{ "JobTitle": map[string]interface{}{"include": []string{"CEO", "Founder"}}, "companyDomain": map[string]interface{}{"include": []string{"airscale.io"}}, "location": map[string]interface{}{"include": []string{"FR"}}, }, "size": 50, }) req, _ := http.NewRequest("POST", "https://api.airscale.io/v1/find-people", bytes.NewBuffer(payload)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, err := (&http.Client{}).Do(req) if err != nil { panic(err) } deferr resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Perform Airsearch Request in Go Source: https://docs.airscale.io/api-reference/airsearch Uses the standard net/http library to send a POST request with a JSON payload. Ensure the Authorization header is set with a valid API key. ```go package main import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { payload, _ := json.Marshal(map[string]interface{}{ "prompt": "What is the funding raised by Mistral AI and who are their investors?", "schema": map[string]interface{}{ "total_funding": "Total funding raised in USD", "latest_round": "string", "investors": "Comma-separated list of investors", }, }) req, _ := http.NewRequest("POST", "https://api.airscale.io/v1/airsearch", bytes.NewBuffer(payload)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, err := (&http.Client{}).Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Check Credit Count with Python Source: https://docs.airscale.io/api-reference/credit-count This Python script demonstrates how to make a POST request to the credits endpoint using the requests library. It prints the status code and response text. ```python import requests url = "https://api.airscale.io/v1/credits" headers = { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" } response = requests.post(url, headers=headers, json={}) print(response.status_code, response.text) ``` -------------------------------- ### Python - Search People Source: https://docs.airscale.io/api-reference/find-people This Python script demonstrates how to use the `requests` library to call the /v1/find-people endpoint. It includes setting the necessary headers and sending a JSON payload for the search query. Remember to replace `YOUR_API_KEY`. ```python import requests response = requests.post( "https://api.airscale.io/v1/find-people", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" }, json={ "query": { "JobTitle": { "include": ["CEO", "Founder"] }, "companyDomain": { "include": ["airscale.io"] }, "location": { "include": ["FR"] } }, "size": 50 } ) print(response.status_code, response.json()) ``` -------------------------------- ### POST /v1/credits Source: https://docs.airscale.io/api-reference/credit-count Retrieve the current number of credits available in your workspace. ```APIDOC ## POST https://api.airscale.io/v1/credits ### Description Use this endpoint to check how many credits you have in your workspace. ### Method POST ### Endpoint https://api.airscale.io/v1/credits ### Response #### Success Response (200) - **status** (string) - The status of the request. - **credits** (string) - The total number of credits available. #### Response Example { "status": "success", "credits": "12000" } ``` -------------------------------- ### Extract Profile via PHP Source: https://docs.airscale.io/api-reference/extract-people-profile Implementation using the cURL extension. ```php "https://www.linkedin.com/in/vdetraz" ]; $ch = curl_init($apiUrl); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . $userApiKey, "Content-Type: application/json" ], CURLOPT_POSTFIELDS => json_encode($payload), CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 60 ]); $response = curl_exec($ch); if ($response === false) { die("cURL Error: " . curl_error($ch)); } ``` -------------------------------- ### Request Body Structure Source: https://docs.airscale.io/api-reference/airsearch The request body requires a prompt and a schema object defining the desired output fields. ```json { "prompt": "Who is the CEO of Airscale and what is their LinkedIn URL?", "schema": { "name": "string", "linkedin_url": "url", "email": "email", "company": "string", "founded_year": "int" } } ``` -------------------------------- ### Extract Profile via Python Source: https://docs.airscale.io/api-reference/extract-people-profile Implementation using the requests library. ```python import requests url = "https://api.airscale.io/v1/profile" headers = { "Authorization": "Bearer YOUR_USER_API_KEY", "Content-Type": "application/json", } json_body = { "linkedin_profile_url": "https://www.linkedin.com/in/vdetraz", # "webhook_url": "https://your.app/receiveProfile", # optional } resp = requests.post(url, headers=headers, json=json_body, timeout=60) print(resp.status_code, resp.text) ``` -------------------------------- ### Extract Profile via JavaScript Source: https://docs.airscale.io/api-reference/extract-people-profile Implementation using the native Fetch API available in Node 18+. ```javascript // Node 18+ has global fetch const url = "https://api.airscale.io/v1/profile"; async function run() { const res = await fetch(url, { method: "POST", headers: { "Authorization": "Bearer YOUR_USER_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ linkedin_profile_url: "https://www.linkedin.com/in/vdetraz", // webhook_url: "https://your.app/receiveProfile", // optional }), }); const text = await res.text(); console.log(res.status, text); } run().catch(console.error); ```