This API lets you customize Google search results based on a specific geographic location. This is particularly useful when you want to view Google search results from different locations, perform local SEO work, or test results across different regions.
To use the API, send a request to the following endpoint:
GET https://www.malatyauyducum.com/search/search_api.php?location=POSTAL_CODE&query=SEARCH_QUERY&country=COUNTRY_CODE
| Parameter | Required | Default | Description |
|---|---|---|---|
location |
Yes | - | Postal code or place name. Specifies the location for the search. |
query |
Yes | - | The search query to look up on Google. |
country |
No | TR | Two-letter ISO country code (e.g., TR, US, DE, UK). |
format |
No | json | Response format. Can be json or redirect. If redirect is selected, you will be directly forwarded to the search results. |
GET https://www.malatyauyducum.com/search/search_api.php?location=44080&query=pizza&country=TR
GET https://www.malatyauyducum.com/search/search_api.php?location=istanbul&query=weather+forecast&country=TR
GET https://www.malatyauyducum.com/search/search_api.php?location=90210&query=best+restaurants&country=US&format=redirect
By default, the API returns data in JSON format. Example response:
{
"success": true,
"search_url": "https://google.com.tr/search?q=pizza&gl=TR&hl=tr&uule=a+CMKC...",
"location": {
"input": "34200",
"resolved": "Istanbul",
"country": "TR",
"latitude": 41.0138,
"longitude": 28.9496
},
"query": "pizza",
"uule": "a+CMKC..."
}
{
"success": false,
"error": "Location not found: 12345 in country: TR"
}
// Sending a request to the API
async function searchWithLocation(location, query, country = 'TR') {
try {
const url = `https://www.malatyauyducum.com/search/search_api.php?location=${encodeURIComponent(location)}&query=${encodeURIComponent(query)}&country=${country}`;
const response = await fetch(url);
if (!response.ok) {
throw new Error(`API request failed: ${response.status}`);
}
const data = await response.json();
if (data.success) {
// Use the search URL
window.open(data.search_url, '_blank');
} else {
// Show error message
console.error(data.error);
}
} catch (error) {
console.error('Request error:', error);
}
}
// Sending a request to the API
function searchWithLocation($location, $query, $country = 'TR') {
$url = "https://www.malatyauyducum.com/search/search_api.php?location=" . urlencode($location) .
"&query=" . urlencode($query) .
"&country=" . $country;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Request error: ' . curl_error($ch);
return false;
}
curl_close($ch);
$data = json_decode($response, true);
if ($data['success']) {
// Use the search URL
header("Location: " . $data['search_url']);
exit;
} else {
// Show error message
echo 'API error: ' . $data['error'];
}
}