Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 865 Bytes

json-api.md

File metadata and controls

27 lines (19 loc) · 865 Bytes

API

When running zoekt-webserver with the -rpc option there will be a JSON HTTP API available for searches at /api/search:

curl -XPOST -d '{"Q":"needle"}' 'http://127.0.0.1:6070/api/search'

Filtering by repository IDs

If your projects are indexed with a repoid (added automatically by some indexers) then you can filter your searches to a subset of repositories efficiently using the RepoIDs filter:

curl -XPOST -d '{"Q":"needle","RepoIDs":[1234,4567]}' 'http://34.120.239.98/api/search'

Options

There are multiple options that can be passed under Opts which can also be found at SearchOptions.

curl -XPOST -d '{"Q":"needle","Opts":{"EstimateDocCount":true,"NumContextLines":10}}' 'http://34.120.239.98/api/search'