The core endpoint. An AI reasoning agent analyzes your query against the catalog and returns the best match with an explanation and install instructions.Every matched response is complete and actionable — install steps, env vars, and a tracked click link are included when the recommended service has a destination URL.
Non-sensitive publisher metadata such as surface, workspace, plan, or placement. Stored with the search for attribution/debugging; not used in the LLM prompt.
Optional private publisher ranking controls. Requires platform_api_key. Supported modes: boost_cpa, cpa_only, and cpa_desc. Economics are not returned in the response.
curl -X POST https://index.trygravity.ai/search \ -H "Content-Type: application/json" \ -H "X-API-Key: $GRAVITY_PUBLISHER_KEY" \ -d '{ "query": "I need a serverless database with a free tier", "external_session_id": "session_123", "external_user_id_hash": "sha256_user_id", "email_hash": "sha256_email", "metadata": {"surface": "chat"} }'
{ "search_id": "238c2e03-347b-438e-8b52-f9cacee31ebe", "recommendation": { "name": "Neon", "slug": "neon", "category": "Database", "description": "Serverless Postgres with branching, autoscaling, and bottomless storage.", "website_url": "https://neon.tech" }, "reasoning": "Neon is the best fit because it's serverless Postgres with a generous free tier, supports edge functions, and has database branching for preview deployments.", "install": { "summary": "Provision a serverless Postgres database", "steps": [ {"step": 1, "action": "Install the Neon driver", "command": "npm install @neondatabase/serverless"}, {"step": 2, "action": "Create a db client", "file": "lib/db.ts"}, {"step": 3, "action": "Add connection string", "file": ".env.local"}, {"step": 4, "action": "Get credentials", "user_action": "Go to https://console.neon.tech → Connection Details"} ], "env_vars": ["DATABASE_URL"] }, "credential_request": { "setup_url": "https://index.trygravity.ai/go/xKHR2xqP9z", "required_env_vars": ["DATABASE_URL"], "user_message": "Open the setup link for Neon, create or find the required credentials, then paste the values for `DATABASE_URL` back into the agent so it can finish the integration.", "agent_instruction": "Pause for any missing credentials, ask the user to open setup_url, then continue once they paste values back.", "grclid": "xKHR2xqP9z" }, "click_url": "https://index.trygravity.ai/go/xKHR2xqP9z", "grclid": "xKHR2xqP9z"}