Google Search

Google AI Mode (JSON Body)

Same behaviour as GET /v1/web/ai-mode, with the parameters sent as a JSON body instead of query string parameters. Use POST for long prompts that do not fit comfortably in a URL. If a parameter is sent in both places, a non-empty query string value takes precedence over the body. In the rare case where Google returns no answer, the response is still 200 with an empty reply_parts array. Every field may be sent either in the JSON body or as a query parameter; when both are present the query parameter wins. A request that supplies prompt as a query parameter therefore needs no body at all.

Price: $0.005 per request. Free tier: 50 requests/month.

post/v1/web/ai-mode

Request

  • Base URL: https://apidirect.io
  • URL: https://apidirect.io/v1/web/ai-mode
  • Auth: API key in header X-API-Key

Query parameters

promptstring

The AI Mode prompt (max 12000 characters). Optional on POST: overrides the same field in the JSON body when both are sent

countrystring

2-letter ISO 3166-1 alpha-2 country code. A value that is not exactly 2 letters is rejected with 400. Optional on POST: overrides the same field in the JSON body when both are sent

languagestring

2-letter ISO 639-1 language code. A value that is not exactly 2 letters is rejected with 400. Optional on POST: overrides the same field in the JSON body when both are sent

session_tokenstring

Token from a previous AI Mode response. Pass it to continue the conversation with prior context. Treat as an opaque string. Optional on POST: overrides the same field in the JSON body when both are sent

Request body

promptstring required

The AI Mode prompt (max 12000 characters)

countrystring

2-letter ISO 3166-1 alpha-2 country code. A value that is not exactly 2 letters is rejected with 400.

languagestring

2-letter ISO 639-1 language code. A value that is not exactly 2 letters is rejected with 400.

session_tokenstring

Token from a previous AI Mode response. Pass it to continue the conversation with prior context. Treat as an opaque string.

Response

Successful response

session_tokenstring nullable

Changes

No recorded changes to this operation across all 1 revision of this API.