Gemini Websearch / URL context -- AI studio results are outdated

using gemini batch api to fill in a database of app links (ios and android) for number of banks in europe. when i use web interface, i get very good result.

when i curl api or do batch requests, i mostly get outdated links. my request is below. i tried both
(1) just using google search as a tool
(2) using url context and feeding specific url

curl “https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent”
-H “x-goog-api-key: $API_KEY”
-H “Content-Type: application/json”
-d ‘{
“contents”: [
{
“parts”: [
{
“text”: “Find the official iOS and Android app links on the following website: Search for keywords like “app store”, “Google Play”. Provide direct links to the store listings.”
}
]
}
],
“tools”: [
{
“url_context”: {}
},
{
“google_search”: {}
}
],
“generationConfig”: {
“temperature”: 0.1
}
}’

1 Like

error": {
“code”: 403,
“message”: “Method doesn’t allow unregistered callers (callers without established identity). Please use an API Key or other form of API consumer identity to call this API.”,
“status”: “PERMISSION_DENIED”
}
}
This 403 is one of the common API errors.
You understand the 403 problem. If you understand 403, it means you also understand how to resolve web searches and contentex or URL context.

the difference is, what do you use in the installation?

i believe you have not updated the api key when executing this curl.

Hi @oxford_command ,

I noticed url_context is empty and the prompt text refers to a ‘following website’ that isn’t included.

Could you please post the exact request body you are running, including the specific target URL? This will help us reproduce the issue.

Thanks