Saved queries

Compile a question into an API

Runs the question once with the example values (a real, verified run), pins the tool it used and learns which of the tool's inputs each {placeholder} fills. The answer names the query's URL: call it with GET /api/v1/q/{queryId}?param=… from then on. When a value is transformed on the way (a city to its code), say where it goes with map.

post/api/v1/queries

Request

  • Base URL: https://unbrowse.ai
  • URL: https://unbrowse.ai/api/v1/queries
  • Auth: one of:
    • OAuth 2 (authorization code, authorization URL https://unbrowse.ai/authorize, token URL https://unbrowse.ai/oauth/token, scopes: unbrowse)
    • HTTP bearer

Request body

querystring required
exampleobject

A value for each {placeholder}, used for the compiling run.

mapobject

Input name → "{param}" or a fixed value, where the example values alone are not enough.

namestring
maxAgeinteger

Seconds an answer may be reused (0, the default: never). A reused answer is not billed.

Example request

{
  "query": "search hn for {topic}"
}

Response

The saved query, with its url and an example call

Object required

Changes

No recorded changes to this operation across all 1 revision of this API.