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"
}
]Headers
A unique value you generate per operation, such as a UUID. Retrying with the same key and the same body returns the stored response instead of running the request again, so a retry after a timeout never charges twice. Successful responses are kept for 24 hours; a failed request is not stored and can be retried with the same key.
255"4f1c2e9a-8a7d-4c1b-9f63-2d6e0b5a7c11"
Body
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.
Was this page helpful?