···11+# API
22+33+When running `zoekt-webserver` with the `-rpc` option there will be a JSON HTTP API available for searches at `/api/search`:
44+55+```
66+curl -XPOST -d '{"Q":"needle"}' 'http://127.0.0.1:6070/api/search'
77+```
88+99+## Filtering by repository IDs
1010+1111+If your projects are indexed with a `repoid` (added automatically by some
1212+indexers) then you can filter your searches to a subset of repositories
1313+efficiently using the `RepoIDs` filter:
1414+1515+```
1616+curl -XPOST -d '{"Q":"needle","RepoIDs":[1234,4567]}' 'http://34.120.239.98/api/search'
1717+```
1818+1919+## Options
2020+2121+There are multiple options that can be passed under `Opts` which can also be
2222+found at
2323+[SearchOptions](https://github.com/sourcegraph/zoekt/blob/58cf4748830ac0eded1517cc8c2454694c531fbd/api.go#L470).
2424+2525+```
2626+curl -XPOST -d '{"Q":"needle","Opts":{"EstimateDocCount":true,"NumContextLines":10}}' 'http://34.120.239.98/api/search'
2727+```