Repository navigation
Document the SERP task request body and expected_serp (DAT-1175) - #3
Merged
Merged
Conversation
POST /v1/serp/classic/tasks had a request body example but no schema. It now has one, with the fields from the public docs: search_engine, device, language_code, location_id or google_ads_location_id, query, tag and pingback_url. It also adds the new optional expected_serp array (SERP API v2): per query, up to 10 domains expected in the top 10, and a domain with an optional expected position (1-100). Items are strict, may be null, and the array must not be longer than query. The example shows a three-keyword request with a null in the middle. JSON and YAML stay in sync. Redocly reports the same 86 warnings as on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hqw2DQwrLyJXtdtoxsUQVB
3 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Updates
POST /v1/serp/classic/tasksinopenapi/data-api.yamland the generatedopenapi/data-api.json.Request body schema
Before this PR the request body had only an example. It now also has a schema, with the fields from the public docs:
search_engine(google),device(desktop|mobile),language_code, andquery(strings of at most 255 characters each; up to 10 keywords per request by default).location_idorgoogle_ads_location_id. One of them must be provided; the schema description says so.tagandpingback_url(with literal$id/$tagplaceholders).New optional
expected_serpexpected_serpis new in SERP API v2. It is an array parallel toquery: item i applies to keyword i. Each item is an object ornull, with no other fields allowed:top10_domains: up to 10 domains expected in the top 10;domain: a domain expected in the results;position: an integer from 1 to 100, which requiresdomain.How the API treats it:
query, but not longer.wwwand duplicates.400with the path of the field, and no tasks are created.The example now shows a three-keyword request with
nullfor the keyword in the middle.Not changed
apikeyquery parameter. Both are left for a separate refresh of the whole spec.Validation
redocly lint openapi/data-api.yamlpasses with the same 86 warnings asmain(84 ×operation-4xx-response,info-license,tag-description). Adding only theexpected_serpproperty would have raised 7 newno-invalid-schema-exampleswarnings for the other example fields; describing them fixes that.data-api.jsonwas regenerated from the YAML, and only this operation changed.Linear: DAT-1175
🤖 Generated with Claude Code
https://claude.ai/code/session_01Hqw2DQwrLyJXtdtoxsUQVB