POST
/
v1
/
repo
/
{repo_id}
/
search
curl -X POST https://api.relace.run/v1/repo/123e4567-e89b-12d3-a456-426614174000/search \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "authenticate"
  }'
{
  "results": [
    {
      "filename": "src/auth.py",
      "line_number": 15,
      "line_content": "def authenticate_user(username, password):",
      "match_start": 4,
      "match_end": 14
    },
    {
      "filename": "src/middleware.py",
      "line_number": 28,
      "line_content": "    # Check if user is authenticated",
      "match_start": 22,
      "match_end": 32
    }
  ]
}

Path Parameters

repo_id
string
required
Repo ID

Request Body

query
string
required
Text pattern to search for

Response

results
array
Array of search results with line matches
curl -X POST https://api.relace.run/v1/repo/123e4567-e89b-12d3-a456-426614174000/search \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "authenticate"
  }'
{
  "results": [
    {
      "filename": "src/auth.py",
      "line_number": 15,
      "line_content": "def authenticate_user(username, password):",
      "match_start": 4,
      "match_end": 14
    },
    {
      "filename": "src/middleware.py",
      "line_number": 28,
      "line_content": "    # Check if user is authenticated",
      "match_start": 22,
      "match_end": 32
    }
  ]
}