curl --request POST \
--url https://app.pipecorn.com/api/v2/locations \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "San Francisco",
"source": "live"
}
'import requests
url = "https://app.pipecorn.com/api/v2/locations"
payload = {
"name": "San Francisco",
"source": "live"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'San Francisco', source: 'live'})
};
fetch('https://app.pipecorn.com/api/v2/locations', 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://app.pipecorn.com/api/v2/locations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'San Francisco',
'source' => 'live'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.pipecorn.com/api/v2/locations"
payload := strings.NewReader("{\n \"name\": \"San Francisco\",\n \"source\": \"live\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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))
}HttpResponse<String> response = Unirest.post("https://app.pipecorn.com/api/v2/locations")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"San Francisco\",\n \"source\": \"live\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.pipecorn.com/api/v2/locations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"San Francisco\",\n \"source\": \"live\"\n}"
response = http.request(request)
puts response.read_body[
{
"name": "San Francisco Bay Area",
"id": "90000084"
},
{
"name": "San Francisco, California, United States",
"id": "102277331"
}
]Location Ids
Get the location id of a specific location
curl --request POST \
--url https://app.pipecorn.com/api/v2/locations \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "San Francisco",
"source": "live"
}
'import requests
url = "https://app.pipecorn.com/api/v2/locations"
payload = {
"name": "San Francisco",
"source": "live"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'San Francisco', source: 'live'})
};
fetch('https://app.pipecorn.com/api/v2/locations', 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://app.pipecorn.com/api/v2/locations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'San Francisco',
'source' => 'live'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.pipecorn.com/api/v2/locations"
payload := strings.NewReader("{\n \"name\": \"San Francisco\",\n \"source\": \"live\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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))
}HttpResponse<String> response = Unirest.post("https://app.pipecorn.com/api/v2/locations")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"San Francisco\",\n \"source\": \"live\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.pipecorn.com/api/v2/locations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"San Francisco\",\n \"source\": \"live\"\n}"
response = http.request(request)
puts response.read_body[
{
"name": "San Francisco Bay Area",
"id": "90000084"
},
{
"name": "San Francisco, California, United States",
"id": "102277331"
}
]Authorizations
Your API key
Body
The name of the location to get the id of
"San Francisco"
Which location catalog to resolve against. live uses LinkedIn Sales Navigator (requires LinkedIn credentials); database uses the internal geo database; hiring uses the hiring-signal catalog. Defaults to live when omitted.
live, database, hiring "live"
Response
Locations retrieved successfully. Each item always includes id and name; additional fields depend on the source.
The ID of the location, to be passed to search endpoints.
The name of the location. For source: live this is the full display name.
Full human-readable location name. Returned for source: hiring only.
ISO 3166-1 alpha-2 country code. Returned for source: hiring only.
Geo-zone kind (e.g. country, region, city). Returned for source: database only.
Human-readable context such as parent regions and kind. Returned for source: database only.
Was this page helpful?