Geocode Search
curl --request POST \
--url https://b.hudhud.sa/v1/geocoding/search \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "Riyadh Zoo"
}
'import requests
url = "https://b.hudhud.sa/v1/geocoding/search"
payload = { "query": "Riyadh Zoo" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: 'Riyadh Zoo'})
};
fetch('https://b.hudhud.sa/v1/geocoding/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://b.hudhud.sa/v1/geocoding/search",
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([
'query' => 'Riyadh Zoo'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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://b.hudhud.sa/v1/geocoding/search"
payload := strings.NewReader("{\n \"query\": \"Riyadh Zoo\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://b.hudhud.sa/v1/geocoding/search")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"Riyadh Zoo\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.hudhud.sa/v1/geocoding/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"Riyadh Zoo\"\n}"
response = http.request(request)
puts response.read_body{
"code": "",
"data": {
"results": [
{
"address_type": "tourism",
"bounding_box": {
"max_lat": 24.678,
"max_lon": 46.742,
"min_lat": 24.673,
"min_lon": 46.735
},
"category": "leisure",
"display_name": "Riyadh Zoo, Mosab Ibn Umair St, Al Malaz, Riyadh 12832, Saudi Arabia",
"lat": 24.6756,
"lon": 46.7386,
"name": "Riyadh Zoo",
"place_id": 123456789,
"type": "zoo"
}
]
},
"error": "",
"ok": true
}{
"code": "",
"data": "<unknown>",
"error": "",
"ok": true
}{
"code": "",
"data": "<unknown>",
"error": "",
"ok": true
}{
"code": "",
"data": "<unknown>",
"error": "",
"ok": true
}{
"code": "",
"data": "<unknown>",
"error": "",
"ok": true
}{
"code": "",
"data": "<unknown>",
"error": "",
"ok": true
}{
"code": "",
"data": "<unknown>",
"error": "",
"ok": true
}{
"code": "",
"data": "<unknown>",
"error": "",
"ok": true
}Geocoding
Geocode Search
Convert an address or place name into geographic coordinates. Returns matching locations with metadata such as coordinates, category, and bounding box.
Retryable errors
Retry these errors with exponential backoff and jitter:
500,503, and504.429with the coderate_limit_exceeded. Wait the number of seconds in theRetry-Afterheader.
Do not retry other errors, which fail again unchanged. A 429 with the code daily_limit_exceeded succeeds after the limit resets at 00:00 UTC; one with trial_limit_reached does not succeed again.
POST
/
geocoding
/
search
Geocode Search
curl --request POST \
--url https://b.hudhud.sa/v1/geocoding/search \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "Riyadh Zoo"
}
'import requests
url = "https://b.hudhud.sa/v1/geocoding/search"
payload = { "query": "Riyadh Zoo" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: 'Riyadh Zoo'})
};
fetch('https://b.hudhud.sa/v1/geocoding/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://b.hudhud.sa/v1/geocoding/search",
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([
'query' => 'Riyadh Zoo'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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://b.hudhud.sa/v1/geocoding/search"
payload := strings.NewReader("{\n \"query\": \"Riyadh Zoo\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://b.hudhud.sa/v1/geocoding/search")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"Riyadh Zoo\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.hudhud.sa/v1/geocoding/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"Riyadh Zoo\"\n}"
response = http.request(request)
puts response.read_body{
"code": "",
"data": {
"results": [
{
"address_type": "tourism",
"bounding_box": {
"max_lat": 24.678,
"max_lon": 46.742,
"min_lat": 24.673,
"min_lon": 46.735
},
"category": "leisure",
"display_name": "Riyadh Zoo, Mosab Ibn Umair St, Al Malaz, Riyadh 12832, Saudi Arabia",
"lat": 24.6756,
"lon": 46.7386,
"name": "Riyadh Zoo",
"place_id": 123456789,
"type": "zoo"
}
]
},
"error": "",
"ok": true
}{
"code": "",
"data": "<unknown>",
"error": "",
"ok": true
}{
"code": "",
"data": "<unknown>",
"error": "",
"ok": true
}{
"code": "",
"data": "<unknown>",
"error": "",
"ok": true
}{
"code": "",
"data": "<unknown>",
"error": "",
"ok": true
}{
"code": "",
"data": "<unknown>",
"error": "",
"ok": true
}{
"code": "",
"data": "<unknown>",
"error": "",
"ok": true
}{
"code": "",
"data": "<unknown>",
"error": "",
"ok": true
}Search for any address, place name, or POI in Saudi Arabia and get back precise coordinates and structured data.
Usage Example
curl --request POST \
--url https://b.hudhud.sa/v1/geocoding/search \
--header 'Authorization: Bearer <your_secret_key>' \
--header 'Content-Type: application/json' \
--data '{
"query": "King Fahd National Library, Riyadh"
}'
Authorizations
Body
application/json
Address or place name to geocode
