Google
Google AI Mode API
Ask Google AI Mode a question and get its answer with the sources it cites. Call the Google AI Mode API for JSON. 2 credits per call.
POST
Ask Google AI Mode a question and get its answer with the sources it cites
Sends a question to Google AI Mode a question and returns its answer with the sources it cites.
Request
query is required.
Response
If successful, the response body contains the standard envelope.data contains Google’s answer in answer and the pages it cites in sources.
The following example is a real response, truncated: each list shows one item and long strings are cut.
For every field, see the response schema on this page.
Optional parameters
Billing
Each successful request consumes 2 credits, regardless of the number of items returned. Requests that fail, or that return no items, are not billed.Pagination
This method is not paginated. A single request returns the complete result.Related methods
- Google Search: Accepts the same
query. Searches Google and returns results, the AI Overview, the knowledge panel and related questions.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The question to ask, worded the way a person would ask it.
Required string length:
1 - 2000ISO 3166-1 alpha-2 country code, e.g. us. Any case is accepted.
Pattern:
^[A-Za-z]{2}$Two-letter language code like en or pt. Any case is accepted.
Pattern:
^[A-Za-z]{2}$