Search LinkedIn Geo ID
curl --request GET \
--url https://api.harvestapi.io/linkedin/geo-id-search \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.harvestapi.io/linkedin/geo-id-search"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.harvestapi.io/linkedin/geo-id-search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.harvestapi.io/linkedin/geo-id-search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.harvestapi.io/linkedin/geo-id-search"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.harvestapi.io/linkedin/geo-id-search")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.harvestapi.io/linkedin/geo-id-search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"entityId": "<string>",
"query": {
"search": "<string>"
},
"status": "<string>",
"error": "<string>",
"elements": [
{
"geoId": "<string>",
"title": "<string>"
}
]
}{
"error": 123,
"message": "<string>"
}LinkedIn GeoID
Search GeoID
Search LinkedIn Geo ID by location text
GET
/
linkedin
/
geo-id-search
Search LinkedIn Geo ID
curl --request GET \
--url https://api.harvestapi.io/linkedin/geo-id-search \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.harvestapi.io/linkedin/geo-id-search"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.harvestapi.io/linkedin/geo-id-search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.harvestapi.io/linkedin/geo-id-search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.harvestapi.io/linkedin/geo-id-search"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.harvestapi.io/linkedin/geo-id-search")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.harvestapi.io/linkedin/geo-id-search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"entityId": "<string>",
"query": {
"search": "<string>"
},
"status": "<string>",
"error": "<string>",
"elements": [
{
"geoId": "<string>",
"title": "<string>"
}
]
}{
"error": 123,
"message": "<string>"
}fetch(`https://api.harvestapi.io/linkedin/geo-id-search?search=Australia`, {
headers: { 'X-API-Key': '<api-key>' },
})
.then((response) => response.json())
.then((data) => console.log(data));
curl --request GET \
--url https://api.harvestapi.io/linkedin/geo-id-search?search=Australia \
--header 'X-API-Key: <api-key>'
import requests
url = "https://api.harvestapi.io/linkedin/geo-id-search?search=Australia"
headers = {"X-API-Key": "<api-key>"}
response = requests.request("GET", url, headers=headers)
print(response.text)
Search by LinkedIn GeoID
For most of the cases, when specifying full location name, the search by thelocation parameter works fine.However sometimes search by location may not give you what you expect, as LinkedIn have some other suggested location for your text query. For example,
NY returns New Zealand instead of New York; UK returns Ukraine instead of United Kingdom.
The location search is based on LinkedIn autocomplete feature, you can try it on the website first.
The scraper will use the first suggestion from the autocomplete popup when you type your location.
The same autocomplete is available via our API. You can look up a location and get LinkedIn GeoID to use for the API endpoint.
const apiKey = '<api-key>';
fetch(`https://api.harvestapi.io/linkedin/geo-id-search?search=New York`, {
headers: { 'X-API-Key': apiKey },
})
.then((response) => response.json())
.then((data) => {
console.log('All matches:', data.elements);
console.log('Closest match GeoID:', data.entityId);
// Search for profiles in New York
const params = new URLSearchParams({
geoId: data.entityId,
apiKey,
});
fetch(`https://api.harvestapi.io/linkedin/profile-search?${params.toString()}`)
.then((response) => response.json())
.then((data) => console.log(data));
});
curl --request GET \
--url https://api.harvestapi.io/linkedin/geo-id-search?search=New%20York \
--header 'X-API-Key: <api-key>'
import requests
url = "https://api.harvestapi.io/linkedin/geo-id-search?search=New York"
headers = {"X-API-Key": "<api-key>"}
response = requests.request("GET", url, headers=headers)
data = response.json()
print("All matches:", data["elements"])
print("Closest match GeoID:", data["id"])

