Skip to main content
POST
/
search
Search
curl --request POST \
  --url https://index.trygravity.ai/search \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>",
  "search_id": "<string>",
  "context": {},
  "platform_api_key": "<string>"
}
'
{
  "search_id": "<string>",
  "recommendation": {
    "name": "<string>",
    "slug": "<string>",
    "category": "<string>",
    "description": "<string>",
    "website_url": "<string>",
    "docs_url": "<string>"
  },
  "reasoning": "<string>",
  "install": {
    "summary": "<string>",
    "steps": [
      {}
    ],
    "env_vars": [
      {}
    ],
    "notes": "<string>"
  },
  "conversion_url": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.trygravity.ai/llms.txt

Use this file to discover all available pages before exploring further.

Search the Index

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 response is complete and actionable — install steps, env vars, and a conversion link are always included.

Request

query
string
required
What you need. Natural language — e.g. “serverless database with free tier” or “auth for Next.js with SSO”
search_id
string
Pass a search_id from a previous response to ask a follow-up question. The Index maintains conversation context.
context
object
Additional project context. Framework, language, constraints, etc.
platform_api_key
string
Publisher API key for CPA attribution. The platform gets paid when the user converts.

Response

search_id
string
Unique ID for this search. Pass it back for follow-ups.
recommendation
object
The recommended service.
reasoning
string
Why this tool is the best fit for your specific query. Natural language explanation.
install
object
Structured install instructions the agent can execute.
conversion_url
string
Tracked short link the user visits to get their API credentials.

Examples

curl -X POST https://index.trygravity.ai/search \
  -H "Content-Type: application/json" \
  -d '{"query": "I need a serverless database with a free tier"}'
{
  "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"]
  },
  "conversion_url": "https://index.trygravity.ai/go/xKHR2xq"
}

Follow-up question

curl -X POST https://index.trygravity.ai/search \
  -H "Content-Type: application/json" \
  -d '{
    "search_id": "238c2e03-347b-438e-8b52-f9cacee31ebe",
    "query": "Does it support database branching for preview deploys?"
  }'
The Index remembers the previous conversation and answers in context.