Skip to main content
POST
Search
The core endpoint for developer services. An AI reasoning agent analyzes your query against the catalog and returns the single best match with an explanation of why it fits. Every matched response includes the reasoning and a tracked click link (when the recommended service has a destination URL) that the agent can hand to the user. Pass your external_session_id so the Index can use the conversation as private supporting context; see Conversation context.
Looking for physical products (shoes, cookware, electronics)? That is a different vertical with a ranked-list response; use POST /shop/search. Sending a shopping query here returns no match.

Authentication

Send your publisher key as the X-API-Key header or as the platform_api_key body field. One of the two is required.
string
Publisher API key. Alternative to the platform_api_key body field.

Request

string
required
What you need. Natural language — e.g. “serverless database with free tier” or “auth for Next.js with SSO”
string
Pass a search_id from a previous response to ask a follow-up question. The Index maintains conversation context.
object
Additional project context the reasoning agent should weigh, e.g. {"framework": "nextjs", "language": "typescript", "constraints": ["free tier", "EU region"]}. Free-form; anything the user already told you about their stack belongs here rather than stuffed into query.
string
Publisher API key for attribution. Alternative to the X-API-Key header — send one or the other.
string
Your stable chat/session ID. Send it by default: when Gravity has a summary of that conversation, Index uses it as private supporting context for the recommendation (see Conversation context). Also used for attribution and payout matching. Never returned in the response.
string
Hash of your user ID. Prefer this over sending a raw user identifier.
string
Optional raw user ID. Gravity stores only a SHA-256 hash.
string
SHA-256 of the user’s normalized email (email.strip().lower()), when available. This is the canonical field and matches the ad request convention. The legacy email_hash field is still accepted as an alias.
object
Non-sensitive publisher metadata such as surface, workspace, plan, or placement. Stored with the search for attribution/debugging; not used in the LLM prompt.
object
Optional private publisher ranking controls. Requires platform_api_key. Supported mode: boost_cpa — relevance-first ranking that gives a small boost to services with an active CPA campaign. Omit (or use off) for pure relevance. Economics are not returned in the response.

Response

string
Unique ID for this search. Pass it back for follow-ups.
object
The recommended service.
string
Why this tool is the best fit for your specific query. Natural language explanation.
object
Optional structured setup details for the recommended service. Present when the catalog has them; agents may ignore this and simply present the recommendation.
object
Explicit handoff instructions for credentials the human user must fetch.
string
Tracked short link the user visits to sign up with the recommended service.
string
Gravity Index click ID minted for the tracked click link.

Examples

Follow-up question

The Index remembers the previous conversation and answers in context.