{"uid":"cap_SlhS0a3XXPmFkscdS35gz","slug":"agents-openwebninja-com-google-ai-mode-search-post-d06a9c55","name":"Google AI Mode Search (POST)","description":"Send a prompt/query and get structured results and reference links from Google's AI Mode. POST variant of the AI Mode endpoint - accepts the same parameters in a JSON request body, with no URL length limit (recommended for long prompts).","url":"https://agents.openwebninja.com/realtime-web-search/ai-mode?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","required":["prompt"],"properties":{"gl":{"type":"string","default":"us","example":"us","description":"The country / region for which to make the query. 2-letter country code, see ISO 3166-1 alpha-2."},"hl":{"type":"string","default":"en","example":"en","description":"The language to use for the search (Google's hl parameter). 2-letter country code, see ISO 639-1 alpha-2."},"tbs":{"type":"string","nullable":true,"description":"This parameter defines advanced search parameters that aren't available using regular query parameters (to be searched)."},"uule":{"type":"string","nullable":true,"description":"Google's own encoded location string (e.g. w+CAIQICIgU2VhdHRsZSxXYXNoaW5ndG9uLFVuaXRlZCBTdGF0ZXM=), passed to Google as is. Use it instead of location when you already generate uule values. Cannot be combined with location."},"query":{"type":"string"},"prompt":{"type":"string","example":"How to make a pizza step by step?","description":"AI Mode prompt."},"location":{"type":"string","nullable":true,"description":"Where the AI Mode search originates from, for location-dependent prompts such as local businesses, weather or events. Recommended to specify at city level to simulate a real user's search (e.g. London, England, United Kingdom). See https://openwebninja.s3.us-east-1.amazonaws.com/locations.json for the list of supported locations. Cannot be combined with uule."},"attachments":{"type":"array","items":{"type":"string"},"example":["https://pdfobject.com/pdf/sample.pdf"],"nullable":true,"description":"Optional list of document URLs (PDF) to attach to the prompt, as plain URL strings. Up to 5 files, 10 MB each. Images are not supported. Attaching one or more documents is charged a flat 1 extra request credit."},"session_token":{"type":"string","nullable":true,"description":"Specify a session token from previous AI Mode response to continue the chat from the same point (preserving history in context for continuous conversation)."}}},"responseSchema":{"type":"object","required":["status","request_id","parameters","data"],"properties":{"data":{"type":"object","required":["reply_parts","reference_links"],"properties":{"reply_parts":{"type":"array","items":{"type":"object","required":["type"],"properties":{"list":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"Item body text."},"title":{"type":"string","nullable":true,"description":"Bold label preceding the item text, when present."}}},"nullable":true,"description":"Items of a list fragment."},"text":{"type":"string","nullable":true,"description":"Text content of paragraph/heading fragments."},"type":{"type":"string","description":"Fragment kind. Values: paragraph, heading, list, images."},"images":{"type":"array","items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"Image URL."},"label":{"type":"string","nullable":true,"description":"Image alt text / caption."},"width":{"type":"integer","nullable":true,"description":"Image width in pixels."},"height":{"type":"integer","nullable":true,"description":"Image height in pixels."}}},"nullable":true,"description":"Images carried by an images fragment."},"ordered":{"type":"boolean","nullable":true,"description":"Whether a list fragment is ordered (numbered)."}}},"description":"Sequenced fragments composing the AI Mode reply (paragraphs, headings, lists, images)."},"session_token":{"type":"string","nullable":true,"description":"Token to pass back as session_token on a follow-up request to continue this conversation. Null when the upstream did not surface one."},"reference_links":{"type":"array","items":{"type":"object","required":["title","link"],"properties":{"date":{"type":"string","nullable":true,"description":"Publication date of the cited page, when present."},"link":{"type":"string","description":"URL of the cited page."},"title":{"type":"string","description":"Title of the cited page."},"source":{"type":"string","nullable":true,"description":"Publisher / source label."},"favicon":{"type":"string","nullable":true,"description":"Favicon URL of the cited page."},"snippet":{"type":"string","nullable":true,"description":"Short excerpt of the cited page."}}},"description":"Citation links referenced by the AI Mode reply."}}},"status":{"type":"string","description":"The status of the API response."},"parameters":{"type":"object","properties":{"gl":{"type":"string","description":"ISO 3166-1 alpha-2 country code used for the search."},"hl":{"type":"string","description":"ISO 639 language code used for the search."},"tbs":{"type":"string","nullable":true,"description":"Advanced Google search parameter (tbs) as received (only when explicitly passed)."},"uule":{"type":"string","nullable":true,"description":"Google uule location string as received (only when explicitly passed)."},"prompt":{"type":"string","description":"The AI Mode prompt as received."},"location":{"type":"string","nullable":true,"description":"Search origin location as received (only when explicitly passed)."},"session_token":{"type":"string","nullable":true,"description":"Session token as received (only when explicitly passed to continue a conversation)."}},"description":"The parameters the API received and used for this request, echoed back."},"request_id":{"type":"string","description":"A unique ID to trace the API request."}}},"example":null,"exampleRequest":null,"tags":[],"displayCostAmount":"unknown","displayCostAsset":"USD","priceDynamic":true,"priceHint":null,"priceStatus":"unprobed","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"unknown","summary":"price unknown","primary":{"kind":"dynamic","protocol":"mpp","network":"tempo","amountUsd":null,"per":"call","confidence":"unknown"},"accepted":[{"kind":"dynamic","protocol":"mpp","network":"tempo","amountUsd":null,"per":"call","confidence":"unknown"}]},"paymentMethods":[{"uid":"pm_wV7ZLfiU3n_VmxvfyPWjY","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"unknown","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":"agents.openwebninja.com","brandSlug":"agents-openwebninja-com-x402","brandBaseUrl":"https://agents.openwebninja.com","brandDocsUrl":null,"whatItDoes":"Sends a prompt to Google's AI Mode and returns a structured, multi-part AI-generated answer with reference links, supporting multi-turn conversation and PDF attachments.","exampleAgentPrompt":"Ask Google AI Mode: what are the best practices for securing a Node.js REST API in 2024? I want a structured answer with sources, searching from the United States in English.","exampleUseCases":[{"title":"Step-by-step how-to research","prompt":"Use Google AI Mode to explain step by step how to file for LLC formation in California — give me a structured breakdown with citations I can follow up on."},{"title":"Location-aware local query","prompt":"Ask Google AI Mode what the best highly-rated sushi restaurants near downtown Seattle, Washington are right now, and include reference links to the sources it uses."},{"title":"PDF document Q&A with AI","prompt":"I have a PDF at https://pdfobject.com/pdf/sample.pdf — send it to Google AI Mode and ask: what are the key terms and conditions described in this document? Give me the answer in structured parts with any relevant source links."}],"resultDescription":"Returns a structured object containing sequenced reply fragments (paragraphs, headings, ordered/unordered lists, and images) composing the AI-generated answer, plus an array of reference links with titles, URLs, source names, and publication dates. Also includes a session_token for continuing the conversation in follow-up requests, a request_id, and status/parameter echo fields.","failureModes":["Missing required 'prompt' field returns a 400 validation error","Prompt too long or malformed JSON returns a 400 error","Combining both 'location' and 'uule' parameters returns an error (mutually exclusive)","More than 5 PDF attachments or files exceeding 10 MB each are rejected","Image attachments (non-PDF) are unsupported and rejected","Invalid session_token causes conversation context to be lost or returns an error","Upstream Google AI Mode unavailability returns a 5xx error","Invalid country code (gl) or language code (hl) may return unexpected or empty results","Insufficient credits/payment results in a 402 Payment Required response"],"whenToPreferThis":"Choose this endpoint when you need AI-synthesized answers from Google's AI Mode with structured output (not raw search results), especially for long or complex prompts where URL length limits would be a concern. Prefer this over the GET variant for prompts exceeding typical URL length limits, when attaching PDF documents, or when maintaining multi-turn conversation state via session tokens. Choose over generic web scraping endpoints when you need synthesized, citation-backed AI answers rather than raw HTML. Use when location-specific or language-specific AI Mode results are needed.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-14T00:36:31.780Z","isFirstParty":false,"canonicalSlug":"agents-openwebninja-com-google-ai-mode-search-post-69308376"}