I am trying to get locations from keywords and the request works fine in studio but not in an actual server.
I’ve tried using User-Agent but it says not allowed to use User-Agent!
Code:
function Http.getRelevantPlaces(keywords: string): {any}
local url = `https://nominatim.openstreetmap.org/search?q={HttpService:UrlEncode(keywords)}&format=json&limit=10`
local success, data = pcall(HttpService.GetAsync, HttpService, url, true)
warn(success, data, url)
data = success and HttpService:JSONDecode(data) or {}
return data
end
Output (URL: https://nominatim.openstreetmap.org/search?q=Roblox&format=json&limit=10):
Real server: Error 403
Normal:
{
[1] = ▼ {
["addresstype"] = "road",
["boundingbox"] = ▼ {
[1] = "37.5408859",
[2] = "37.5412940",
[3] = "-122.2996601",
[4] = "-122.2988741"
},
["class"] = "highway",
["display_name"] = "Roblox Way, Hillsdale, San Mateo, San Mateo County, California, 94403, United States",
["importance"] = 0.05339612191958492,
["lat"] = "37.5410899",
["licence"] = "Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright",
["lon"] = "-122.2992671",
["name"] = "Roblox Way",
["osm_id"] = 491031352,
["osm_type"] = "way",
["place_id"] = 298906661,
["place_rank"] = 26,
["type"] = "residential"
},
[2] = ▼ {
["addresstype"] = "building",
["boundingbox"] = ▼ {
[1] = "37.5427520",
[2] = "37.5438351",
[3] = "-122.3020754",
[4] = "-122.3007397"
},
["class"] = "building",
["display_name"] = "Roblox Corporation Station 1, 2750, South Delaware Street, San Mateo, San Mateo County, California, 94403, United States",
["importance"] = 6.278858625157576e-05,
["lat"] = "37.5433164",
["licence"] = "Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright",
["lon"] = "-122.3014468",
["name"] = "Roblox Corporation Station 1",
["osm_id"] = 1076151388,
["osm_type"] = "way",
["place_id"] = 298906662,
["place_rank"] = 30,
["type"] = "office"
},
[3] = ▶ {...},
[4] = ▶ {...},
[5] = ▶ {...}
}
I do assume the website I’m using needs some sort of authentication but I’m unsure what exactly.