Skip to content
OpenCode
Esc
navigateopen⌘Jpreview

Search the web

Run one web search through the selected provider. Specify a provider to override the configured default.

POST/api/websearch
Query parameters
locationobject | any
Request body
requiredapplication/json
querystringrequired
providerIDstring
Responses
200Success
locationLocation.Inforequired
Show properties
directorystringrequired
workspaceIDobject
Show properties
object
projectobjectrequired
Show properties
idstringrequired
directorystringrequired
dataWebSearch.Responserequired
Show properties
providerIDstringrequired
resultsWebSearch.Result[]required
Show properties
Array of WebSearch.Result
urlstringrequired
titlestring
contentstring
timeobjectrequired
Show properties
publishednumber
400InvalidRequestError
Any of:
InvalidRequestError1
_tagstringrequired
Allowed:InvalidRequestError
messagestringrequired
kindstring | any
Show properties
Any of:
string
string
any
any
fieldstring | any
Show properties
Any of:
string
string
any
any
InvalidRequestError
_tagstringrequired
Allowed:InvalidRequestError
messagestringrequired
kindstring | any
Show properties
Any of:
string
string
any
any
fieldstring | any
Show properties
Any of:
string
string
any
any
401UnauthorizedError
_tagstringrequired
Allowed:UnauthorizedError
messagestringrequired
503ServiceUnavailableError
_tagstringrequired
Allowed:ServiceUnavailableError
messagestringrequired
servicestring | any
Show properties
Any of:
string
string
any
any
Request
curl -X POST "/api/websearch" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "string",
  "providerID": "string"
}'
Response
{
  "location": {
    "directory": "string",
    "workspaceID": {},
    "project": {
      "id": "string",
      "directory": "string"
    }
  },
  "data": {
    "providerID": "string",
    "results": [
      {
        "url": "string",
        "title": "string",
        "content": "string",
        "time": {
          "published": 0
        }
      }
    ]
  }
}