### Go example for account usage Source: https://docs.generect.com/api-reference/endpoint/accounts/get-account-usage Uses the net/http package to send a GET request and prints the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.generect.com/api/v1/accounts/usage/?timezone=UTC&period=day" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Ruby example for account usage Source: https://docs.generect.com/api-reference/endpoint/accounts/get-account-usage Uses Net::HTTP to send a GET request and prints the response body. ```ruby require 'uri' require 'net/http' url = URI("https://api.generect.com/api/v1/accounts/usage/?timezone=UTC&period=day") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = '' response = http.request(request) puts response.read_body ``` -------------------------------- ### Go example for bulk lead enrich job Source: https://docs.generect.com/api-reference/endpoint/enrich/get-leads-bulk Go example using net/http to GET the bulk lead enrichment job. Replace {job_id} and with your values. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.generect.com/api/v1/enrich/leads/bulk/{job_id}/" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Go example for bulk email find job Source: https://docs.generect.com/api-reference/endpoint/emails/get-email-finder-bulk Uses net/http to send a GET request with an Authorization header. Reads and prints the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.generect.com/api/v1/email/find/bulk/{job_id}/" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Ruby example for bulk lead enrich job Source: https://docs.generect.com/api-reference/endpoint/enrich/get-leads-bulk Ruby example using Net::HTTP to GET the bulk lead enrichment job. Replace {job_id} and with your values. ```ruby require 'uri' require 'net/http' url = URI("https://api.generect.com/api/v1/enrich/leads/bulk/{job_id}/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = '' response = http.request(request) puts response.read_body ``` -------------------------------- ### Ruby example for bulk email find job Source: https://docs.generect.com/api-reference/endpoint/emails/get-email-finder-bulk Uses Net::HTTP to send a GET request with an Authorization header. Prints the response body. ```ruby require 'uri' require 'net/http' url = URI("https://api.generect.com/api/v1/email/find/bulk/{job_id}/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = '' response = http.request(request) puts response.read_body ``` -------------------------------- ### Successful response example for counting preview leads Source: https://docs.generect.com/api-reference/endpoint/preview/count-preview-leads Example of a 200 response showing the count of matching leads and the amount charged (0 in this example). ```json { "data": { "count": 1240 }, "meta": { "amount_charged": 0 } } ``` -------------------------------- ### Python requests example for account usage Source: https://docs.generect.com/api-reference/endpoint/accounts/get-account-usage Uses the requests library to perform a GET request. Prints the response text. ```python import requests url = "https://api.generect.com/api/v1/accounts/usage/?timezone=UTC&period=day" headers = {"Authorization": ""} response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### Java Unirest example for bulk lead enrich job Source: https://docs.generect.com/api-reference/endpoint/enrich/get-leads-bulk Java example using Unirest to GET the bulk lead enrichment job. Replace {job_id} and with your values. ```java HttpResponse response = Unirest.get("https://api.generect.com/api/v1/enrich/leads/bulk/{job_id}/") .header("Authorization", "") .asString(); ``` -------------------------------- ### Java Unirest example for account usage Source: https://docs.generect.com/api-reference/endpoint/accounts/get-account-usage Uses the Unirest library to send a GET request and returns the response as a string. ```java HttpResponse response = Unirest.get("https://api.generect.com/api/v1/accounts/usage/?timezone=UTC&period=day") .header("Authorization", "") .asString(); ``` -------------------------------- ### JavaScript fetch example for bulk lead enrich job Source: https://docs.generect.com/api-reference/endpoint/enrich/get-leads-bulk JavaScript example using fetch to GET the bulk lead enrichment job. Replace {job_id} and with your values. ```javascript const options = {method: 'GET', headers: {Authorization: ''}}; fetch('https://api.generect.com/api/v1/enrich/leads/bulk/{job_id}/', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` -------------------------------- ### Python requests example for bulk lead enrich job Source: https://docs.generect.com/api-reference/endpoint/enrich/get-leads-bulk Python example using the requests library to GET the bulk lead enrichment job. Replace {job_id} and with your values. ```python import requests url = "https://api.generect.com/api/v1/enrich/leads/bulk/{job_id}/" headers = {"Authorization": ""} response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### JavaScript fetch example for account usage Source: https://docs.generect.com/api-reference/endpoint/accounts/get-account-usage Uses the fetch API to make a GET request and logs the JSON response. ```javascript const options = {method: 'GET', headers: {Authorization: ''}}; fetch('https://api.generect.com/api/v1/accounts/usage/?timezone=UTC&period=day', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` -------------------------------- ### Successful response example Source: https://docs.generect.com/api-reference/endpoint/accounts/get-account-usage Example of a 200 response with credit usage data. ```json { "data": { "period": "2026-05", "total_credits": 1234, "breakdown": { "search_database": 500, "search_realtime": 200, "enrich_database": 300, "enrich_realtime": 100, "email_find": 134 } } } ``` -------------------------------- ### Successful Response for Get Bulk Leads Source: https://docs.generect.com/api-reference/endpoint/enrich/get-leads-bulk Example 200 response showing enriched lead data and job metadata. Includes fields like lead details, job status, and amount charged. ```json { "data": [ { "input": { "linkedin_url": "https://www.linkedin.com/in/jordan-ellis" }, "lead": { "id": "ACwAAAE9bk0BxY7Qf2mN4pR8sT1vW3zA5cE6gH9", "linkedin_id": "78461298", "first_name": "Jordan", "last_name": "Ellis", "full_name": "Jordan Ellis", "headline": "CEO at Microsoft", "job_title": "Chief Executive Officer", "company_name": "Microsoft", "company_industry": "Software Development", "linkedin_company_id": "1035", "linkedin_url": "https://www.linkedin.com/in/jordan-ellis", "location": "San Francisco, California, United States", "location_country": "United States", "gender": "male", "is_premium": true, "jobs": [ { "company_name": "Microsoft", "job_title": "Chief Executive Officer", "job_started_on": "2014-02-01", "job_still_working": true } ], "educations": [], "languages": [], "source": "lead_by_link" } }, { "input": { "id": "ACwAAAFp2r4Bd1eF3gH5iJ7kL9mN0pQ2rS4tU6v" }, "lead": null } ], "meta": { "job_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7", "status": "completed", "total": 2, "processed": 2, "found": 1, "not_found": 1, "amount_charged": 0.04, "error": null } } ``` -------------------------------- ### 200 response example Source: https://docs.generect.com/api-reference/endpoint/enrich/enrich-realtime-company Example JSON response for a successful request. Contains the company profile data and meta information including the amount charged. ```json { "data": { "id": 1035, "name": "Microsoft", "domain": "microsoft.com", "linkedin_url": "https://www.linkedin.com/company/microsoft/", "industry": "Software Development", "headcount": 150 }, "meta": { "amount_charged": 0.04 } } ``` -------------------------------- ### Example response for search company leads Source: https://docs.generect.com/api-reference/endpoint/search/database-company-leads Example JSON response from the company-leads endpoint. Shows a lead object with lead_id, first_name, last_name, results_count, and amount_charged. ```json { "data": { "leads": [ { "lead_id": "ACwAAAE9bk0BxY7Qf2mN4pR8sT1vW3zA5cE6gH9", "first_name": "Jordan", "last_name": "Ellis" } ], "results_count": 320 }, "meta": { "amount_charged": 6.4 } } ``` -------------------------------- ### mcp-remote Configuration Example Source: https://docs.generect.com/integrations/mcp/remote-mcp Example configuration for using Generect MCP with the mcp-remote client. Replace YOUR_API_KEY with your actual API key. ```json { "mcpServers": { "generect": { "command": "mcp-remote", "args": [ "https://mcp.generect.com/mcp", "--header", "Authorization: Bearer YOUR_API_KEY" ] } } } ``` -------------------------------- ### Go example for counting preview leads Source: https://docs.generect.com/api-reference/endpoint/preview/count-preview-leads Uses net/http to send a POST request with a JSON string payload. Prints the response body. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.generect.com/api/v1/preview/leads/count/" payload := strings.NewReader("{\n \"company_search_criteria\": {\n \"industries\": [\n \"Software Development\"\n ],\n \"locations\": [\n \"United States\"\n ]\n },\n \"lead_search_criteria\": {\n \"job_titles\": [\n \"CEO\"\n ],\n \"locations\": [\n \"United States\"\n ]\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Go example for search database leads Source: https://docs.generect.com/api-reference/endpoint/search/database-leads Uses net/http to POST the payload. Prints the response body. Requires an API key. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.generect.com/api/v1/search/database/leads/" payload := strings.NewReader("{\n \"job_titles\": [\n \"CEO\",\n \"Founder\"\n ],\n \"seniorities\": [\n \"c_suite\"\n ],\n \"locations\": [\n \"United States\"\n ],\n \"company_industries\": [\n \"Software Development\"\n ],\n \"company_headcounts\": [\n \"51-200\"\n ],\n \"limit_by\": 50,\n \"skip_truncated_names\": false\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Go example for bulk phone find Source: https://docs.generect.com/api-reference/endpoint/phone/phone-finder-bulk Uses net/http to POST the payload. Prints the response body. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.generect.com/api/v1/phone/find/bulk/" payload := strings.NewReader("{\n \"leads\": [\n {\n \"lead_id\": \"ACwAAAE9bk0BxY7Qf2mN4pR8sT1vW3zA5cE6gH9\"\n },\n {\n \"first_name\": \"Jordan\",\n \"last_name\": \"Ellis\",\n \"company\": \"microsoft.com\"\n }\n ]\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### PHP cURL example for bulk lead enrich job Source: https://docs.generect.com/api-reference/endpoint/enrich/get-leads-bulk PHP example using cURL to GET the bulk lead enrichment job. Replace {job_id} and with your values. ```php "https://api.generect.com/api/v1/enrich/leads/bulk/{job_id}/", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: " ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } ``` -------------------------------- ### Preview leads with Go Source: https://docs.generect.com/api-reference/endpoint/preview/preview-leads Uses the net/http package to POST the search criteria as a JSON string and prints the response body. Requires an API key in the Authorization header. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.generect.com/api/v1/preview/leads/" payload := strings.NewReader("{\n \"company_search_criteria\": {\n \"industries\": [\n \"Software Development\"\n ],\n \"headcounts\": [\n \"51-200\"\n ],\n \"locations\": [\n \"United States\"\n ]\n },\n \"lead_search_criteria\": {\n \"job_titles\": [\n \"CEO\",\n \"Founder\"\n ],\n \"seniorities\": [\n \"c_suite\"\n ],\n \"locations\": [\n \"United States\"\n ],\n \"limit_by\": 25\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Go example for realtime companies search Source: https://docs.generect.com/api-reference/endpoint/search/realtime-companies Uses net/http to POST the search payload as a JSON string. Prints the response body. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.generect.com/api/v1/search/realtime/companies/" payload := strings.NewReader("{\n \"industries\": [\n \"Software Development\"\n ],\n \"headcounts\": [\n \"51-200\"\n ],\n \"locations\": [\n \"United States\"\n ],\n \"limit_by\": 50,\n \"sub_industries\": false,\n \"apply_domain_blocklist\": true,\n \"hiring_on_linkedin\": false,\n \"include_total_count\": false\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Go example for search database companies Source: https://docs.generect.com/api-reference/endpoint/search/database-companies Uses net/http to POST the search payload as a JSON string. Prints the response body. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.generect.com/api/v1/search/database/companies/" payload := strings.NewReader("{\n \"industries\": [\n \"Software Development\"\n ],\n \"headcounts\": [\n \"51-200\"\n ],\n \"locations\": [\n \"United States\"\n ],\n \"limit_by\": 50,\n \"sub_industries\": false,\n \"apply_domain_blocklist\": true\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Go example for bulk lead enrich Source: https://docs.generect.com/api-reference/endpoint/enrich/enrich-realtime-leads-bulk Uses net/http to POST the payload as a raw JSON string. Prints the response body. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.generect.com/api/v1/enrich/realtime/leads/bulk/" payload := strings.NewReader("{\n \"leads\": [\n {\n \"linkedin_url\": \"https://www.linkedin.com/in/jordan-ellis\"\n },\n {\n \"id\": \"ACwAAAE9bk0BxY7Qf2mN4pR8sT1vW3zA5cE6gH9\"\n }\n ]\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Go example for realtime leads search Source: https://docs.generect.com/api-reference/endpoint/search/realtime-leads Uses Go's net/http package to send a POST request with a JSON payload. The response body is read and printed. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.generect.com/api/v1/search/realtime/leads/" payload := strings.NewReader("{\n \"job_titles\": [\n \"CEO\",\n \"Founder\"\n ],\n \"seniorities\": [\n \"c_suite\"\n ],\n \"locations\": [\n \"United States\"\n ],\n \"company_industries\": [\n \"Software Development\"\n ],\n \"company_headcounts\": [\n \"51-200\"\n ],\n \"limit_by\": 50,\n \"skip_truncated_names\": false,\n \"mentioned_in_news\": false,\n \"changed_jobs\": false,\n \"posted_on_linkedin\": false,\n \"include_full_profile\": false,\n \"include_total_count\": false\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Python requests example for counting preview leads Source: https://docs.generect.com/api-reference/endpoint/preview/count-preview-leads Uses the requests library to POST the search criteria to the endpoint and prints the response text. Replace with your API key. ```python import requests url = "https://api.generect.com/api/v1/preview/leads/count/" payload = { "company_search_criteria": { "industries": ["Software Development"], "locations": ["United States"] }, "lead_search_criteria": { "job_titles": ["CEO"], "locations": ["United States"] } } headers = { "Authorization": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.text) ``` -------------------------------- ### Go example for counting realtime leads Source: https://docs.generect.com/api-reference/endpoint/search/count-realtime-leads Uses net/http to POST a JSON payload to the count endpoint. Prints the response body. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.generect.com/api/v1/search/realtime/leads/count/" payload := strings.NewReader("{\n \"job_titles\": [\n \"CEO\",\n \"Founder\"\n ],\n \"seniorities\": [\n \"c_suite\"\n ],\n \"locations\": [\n \"United States\"\n ],\n \"company_industries\": [\n \"Software Development\"\n ],\n \"company_headcounts\": [\n \"51-200\"\n ],\n \"limit_by\": 50,\n \"skip_truncated_names\": false,\n \"mentioned_in_news\": false,\n \"changed_jobs\": false,\n \"posted_on_linkedin\": false,\n \"include_full_profile\": false,\n \"include_total_count\": false\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### PHP cURL example for account usage Source: https://docs.generect.com/api-reference/endpoint/accounts/get-account-usage Uses PHP cURL to send a GET request. Handles errors and prints the response. ```php "https://api.generect.com/api/v1/accounts/usage/?timezone=UTC&period=day", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: " ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } ``` -------------------------------- ### JavaScript fetch example for counting preview leads Source: https://docs.generect.com/api-reference/endpoint/preview/count-preview-leads Uses the fetch API to POST the search criteria and logs the JSON response. Replace with your API key. ```javascript const options = { method: 'POST', headers: {Authorization: '', 'Content-Type': 'application/json'}, body: JSON.stringify({ company_search_criteria: {industries: ['Software Development'], locations: ['United States']}, lead_search_criteria: {job_titles: ['CEO'], locations: ['United States']} }) }; fetch('https://api.generect.com/api/v1/preview/leads/count/', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` -------------------------------- ### Go example for token analytics Source: https://docs.generect.com/api-reference/endpoint/accounts/get-account-token-analytics Use Go's net/http to fetch token analytics. Requires an API key in the Authorization header. Prints the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.generect.com/api/v1/accounts/tokens/analytics/?timezone=UTC" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Java Unirest example for bulk email find job Source: https://docs.generect.com/api-reference/endpoint/emails/get-email-finder-bulk Uses the Unirest HTTP library to send a GET request with an Authorization header. Returns the response as a string. ```java HttpResponse response = Unirest.get("https://api.generect.com/api/v1/email/find/bulk/{job_id}/") .header("Authorization", "") .asString(); ``` -------------------------------- ### JavaScript fetch example for bulk email find job Source: https://docs.generect.com/api-reference/endpoint/emails/get-email-finder-bulk Uses the fetch API to make a GET request with an Authorization header. Logs the JSON response or error to the console. ```javascript const options = {method: 'GET', headers: {Authorization: ''}}; fetch('https://api.generect.com/api/v1/email/find/bulk/{job_id}/', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` -------------------------------- ### Example response for search realtime leads Source: https://docs.generect.com/api-reference/endpoint/search/realtime-leads Shows a sample response from the realtime leads endpoint. Includes lead data with lead_id, first_name, last_name, title, and results_count. Also includes meta with amount_charged. ```json { "data": { "leads": [ { "lead_id": "ACwAAAE9bk0BxY7Qf2mN4pR8sT1vW3zA5cE6gH9", "first_name": "Jordan", "last_name": "Ellis", "title": "CEO" } ], "results_count": 1240 }, "meta": { "amount_charged": 49.6 } } ``` -------------------------------- ### PHP cURL example for bulk email find job Source: https://docs.generect.com/api-reference/endpoint/emails/get-email-finder-bulk Uses PHP cURL to send a GET request with an Authorization header. Outputs the response or a cURL error if one occurs. ```php "https://api.generect.com/api/v1/email/find/bulk/{job_id}/", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: " ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } ``` -------------------------------- ### Sample response for search database leads Source: https://docs.generect.com/api-reference/endpoint/search/database-leads Example JSON response showing a lead object with lead_id, first_name, last_name, title, results_count, and meta.amount_charged. ```json { "data": { "leads": [ { "lead_id": "ACwAAAE9bk0BxY7Qf2mN4pR8sT1vW3zA5cE6gH9", "first_name": "Jordan", "last_name": "Ellis", "title": "CEO" } ], "results_count": 1240 }, "meta": { "amount_charged": 24.8 } } ``` -------------------------------- ### Python requests example for bulk email find job Source: https://docs.generect.com/api-reference/endpoint/emails/get-email-finder-bulk Uses the requests library to perform a GET request. Prints the response text. Replace {job_id} and with actual values. ```python import requests url = "https://api.generect.com/api/v1/email/find/bulk/{job_id}/" headers = {"Authorization": ""} response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### Go example to validate emails Source: https://docs.generect.com/api-reference/endpoint/emails/email-validation Uses net/http to send a POST request with a JSON payload. Prints the response body. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.generect.com/api/v1/email/validate/" payload := strings.NewReader("{\n \"emails\": [\n \"jordan.ellis@microsoft.com\",\n \"morgan.lee@salesforce.com\"\n ]\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Go example for find phone Source: https://docs.generect.com/api-reference/endpoint/phone/phone-finder Uses net/http to POST a lead_id to the find phone endpoint. Prints the response body. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.generect.com/api/v1/phone/find/" payload := strings.NewReader("{\n \"lead_id\": \"ACwAAAE9bk0BxY7Qf2mN4pR8sT1vW3zA5cE6gH9\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Ruby Net::HTTP example for counting preview leads Source: https://docs.generect.com/api-reference/endpoint/preview/count-preview-leads Uses Net::HTTP to send a POST request with a JSON string body. Prints the response body. ```ruby require 'uri' require 'net/http' url = URI("https://api.generect.com/api/v1/preview/leads/count/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"company_search_criteria\": {\n \"industries\": [\n \"Software Development\"\n ],\n \"locations\": [\n \"United States\"\n ]\n },\n \"lead_search_criteria\": {\n \"job_titles\": [\n \"CEO\"\n ],\n \"locations\": [\n \"United States\"\n ]\n }\n}" response = http.request(request) puts response.read_body ``` -------------------------------- ### 401 error response example Source: https://docs.generect.com/api-reference/endpoint/accounts/get-account-usage Example of a 401 error response when authentication credentials are missing or invalid. ```json { "status": "error", "status_code": 401, "detail": "Authentication credentials were not provided." } ``` -------------------------------- ### JavaScript fetch example for search database leads Source: https://docs.generect.com/api-reference/endpoint/search/database-leads Uses fetch to POST the payload and logs the JSON response. Requires an API key. ```javascript const options = { method: 'POST', headers: {Authorization: '', 'Content-Type': 'application/json'}, body: JSON.stringify({ job_titles: ['CEO', 'Founder'], seniorities: ['c_suite'], locations: ['United States'], company_industries: ['Software Development'], company_headcounts: ['51-200'], limit_by: 50, skip_truncated_names: false }) }; fetch('https://api.generect.com/api/v1/search/database/leads/', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` -------------------------------- ### 403 error response example Source: https://docs.generect.com/api-reference/endpoint/accounts/get-account-usage Example of a 403 error response when the user lacks permission to perform the action. ```json { "status": "error", "status_code": 403, "detail": "You do not have permission to perform this action." } ``` -------------------------------- ### GET /api/v1/accounts/usage/ Source: https://docs.generect.com/api-reference/migration-guide Retrieves the account's usage information. This is the v1 replacement for the legacy `GET /api/auth/transactions/spent_credits/` endpoint. ```APIDOC ## GET /api/v1/accounts/usage/ ### Description Retrieves the account's usage information. This is the v1 replacement for the legacy `GET /api/auth/transactions/spent_credits/` endpoint. ### Method GET ### Endpoint `/api/v1/accounts/usage/` ### Response #### Success Response (200) - **data** (object) - Usage details. #### Response Example ```json { "data": {} } ``` ``` -------------------------------- ### Go: Count database leads with net/http Source: https://docs.generect.com/api-reference/endpoint/search/count-database-leads Uses the standard net/http package to POST the search criteria to the count endpoint. Prints the response body. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.generect.com/api/v1/search/database/leads/count/" payload := strings.NewReader("{\n \"job_titles\": [\n \"CEO\",\n \"Founder\"\n ],\n \"seniorities\": [\n \"c_suite\"\n ],\n \"locations\": [\n \"United States\"\n ],\n \"company_industries\": [\n \"Software Development\"\n ],\n \"company_headcounts\": [\n \"51-200\"\n ],\n \"limit_by\": 50,\n \"skip_truncated_names\": false\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### company_search_criteria Example Source: https://docs.generect.com/api-reference/endpoint/search/database-company-leads Example of the company_search_criteria object for the request body. It filters by industries, headcounts, locations, and limits results to 50. ```json { "industries": ["Software Development"], "headcounts": ["51-200"], "locations": ["United States"], "limit_by": 50 } ``` -------------------------------- ### Go example for counting database companies Source: https://docs.generect.com/api-reference/endpoint/search/count-database-companies Uses the net/http package to POST the filter payload to the count endpoint and prints the response body. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.generect.com/api/v1/search/database/companies/count/" payload := strings.NewReader("{\n \"industries\": [\n \"Software Development\"\n ],\n \"headcounts\": [\n \"51-200\"\n ],\n \"locations\": [\n \"United States\"\n ],\n \"limit_by\": 50,\n \"sub_industries\": false,\n \"apply_domain_blocklist\": true\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Ruby example for search database companies Source: https://docs.generect.com/api-reference/endpoint/search/database-companies Uses Net::HTTP to POST the search payload as a JSON string. Prints the response body. ```ruby require 'uri' require 'net/http' url = URI("https://api.generect.com/api/v1/search/database/companies/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"industries\": [\n \"Software Development\"\n ],\n \"headcounts\": [\n \"51-200\"\n ],\n \"locations\": [\n \"United States\"\n ],\n \"limit_by\": 50,\n \"sub_industries\": false,\n \"apply_domain_blocklist\": true\n}" response = http.request(request) puts response.read_body ``` -------------------------------- ### 400 error response example Source: https://docs.generect.com/api-reference/endpoint/preview/count-preview-leads Example of a 400 error response indicating that a provided value does not exist, such as an invalid company headcount. ```json { "status": "error", "status_code": 400, "detail": { "company_headcounts": [ "Object with name=999 does not exist." ] } } ``` -------------------------------- ### Example response: Count database leads Source: https://docs.generect.com/api-reference/endpoint/search/count-database-leads Shows a successful response with the results_count and the amount_charged in the meta object. ```json { "data": { "results_count": 1240 }, "meta": { "amount_charged": 0 } } ``` -------------------------------- ### GET /api/v1/accounts/me/ Source: https://docs.generect.com/api-reference/migration-guide Retrieves the current user's account information. This is the v1 replacement for the legacy `GET /api/auth/users/me/` endpoint. ```APIDOC ## GET /api/v1/accounts/me/ ### Description Retrieves the current user's account information. This is the v1 replacement for the legacy `GET /api/auth/users/me/` endpoint. ### Method GET ### Endpoint `/api/v1/accounts/me/` ### Response #### Success Response (200) - **data** (object) - Account details. #### Response Example ```json { "data": {} } ``` ``` -------------------------------- ### GET /api/v1/accounts/transactions/ Source: https://docs.generect.com/api-reference/migration-guide Lists account transactions. Replaces the legacy GET /api/auth/transactions/ endpoint. Response fields have been renamed and nested. ```APIDOC ## GET /api/v1/accounts/transactions/ ### Description Lists account transactions. Replaces the legacy GET /api/auth/transactions/ endpoint. Response fields have been renamed and nested. ### Method GET ### Endpoint /api/v1/accounts/transactions/ ### Response #### Success Response (200) - **data.transactions[].id** (string) - Transaction ID. - **data.transactions[].timestamp** (string) - Transaction timestamp (renamed from created_at). - **data.transactions[].credits** (number) - Credit amount (renamed from amount). - **data.transactions[].type** (string) - Transaction type (renamed from balance_type). - **data.transactions[].details.status** (string) - Transaction status (nested from status). #### Response Example { "data": { "transactions": [ { "id": "txn_123", "timestamp": "2023-01-01T00:00:00Z", "credits": 100, "type": "purchase", "details": { "status": "completed" } } ] } } ``` -------------------------------- ### PHP cURL to get account transactions Source: https://docs.generect.com/api-reference/endpoint/accounts/get-account-transactions Uses PHP cURL to perform a GET request and output the response or error. ```php "https://api.generect.com/api/v1/accounts/transactions/?limit=100", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: " ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } ``` -------------------------------- ### Go example for bulk email find Source: https://docs.generect.com/api-reference/endpoint/emails/email-finder-bulk Uses net/http to POST a JSON payload to the bulk email find endpoint. Prints the response body. Requires an API key. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.generect.com/api/v1/email/find/bulk/" payload := strings.NewReader("{\n \"leads\": [\n {\n \"lead_id\": \"ACwAAAE9bk0BxY7Qf2mN4pR8sT1vW3zA5cE6gH9\"\n },\n {\n \"first_name\": \"Morgan\",\n \"last_name\": \"Lee\",\n \"domain\": \"salesforce.com\"\n }\n ]\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Python requests to get account transactions Source: https://docs.generect.com/api-reference/endpoint/accounts/get-account-transactions Uses the requests library to perform a GET request and print the response text. ```python import requests url = "https://api.generect.com/api/v1/accounts/transactions/?limit=100" headers = {"Authorization": ""} response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### JavaScript fetch example for realtime company leads Source: https://docs.generect.com/api-reference/endpoint/search/realtime-company-leads Uses fetch to POST the payload and logs the JSON response. Requires an API key. ```javascript const options = { method: 'POST', headers: {Authorization: '', 'Content-Type': 'application/json'}, body: JSON.stringify({ company_search_criteria: { industries: ['Software Development'], headcounts: ['51-200'], locations: ['United States'], sub_industries: false, apply_domain_blocklist: true, hiring_on_linkedin: false, include_total_count: false }, lead_search_criteria: { job_titles: ['CEO'], seniorities: ['c_suite'], locations: ['United States'], skip_truncated_names: false, mentioned_in_news: false, changed_jobs: false, posted_on_linkedin: false, include_full_profile: false, include_total_count: false, include_emails: false } }) }; fetch('https://api.generect.com/api/v1/search/realtime/company-leads/', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` -------------------------------- ### Ruby Net::HTTP example for search database leads Source: https://docs.generect.com/api-reference/endpoint/search/database-leads Uses Net::HTTP to POST the payload and prints the response body. Requires an API key. ```ruby require 'uri' require 'net/http' url = URI("https://api.generect.com/api/v1/search/database/leads/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"job_titles\": [\n \"CEO\",\n \"Founder\"\n ],\n \"seniorities\": [\n \"c_suite\"\n ],\n \"locations\": [\n \"United States\"\n ],\n \"company_industries\": [\n \"Software Development\"\n ],\n \"company_headcounts\": [\n \"51-200\"\n ],\n \"limit_by\": 50,\n \"skip_truncated_names\": false\n}" response = http.request(request) puts response.read_body ``` -------------------------------- ### cURL request to get account transactions Source: https://docs.generect.com/api-reference/endpoint/accounts/get-account-transactions Uses cURL to send a GET request to the transactions endpoint with an Authorization header. ```bash curl --request GET \ --url 'https://api.generect.com/api/v1/accounts/transactions/?limit=100' \ --header 'Authorization: ' ```