Skip to content
Fous Docs
MarkdownStudio

Runs

Run a method with your own input, or send a query and get the result.

The Run object

  • idstringrequired

    run_ followed by 26 characters; results are kept 24 hours.

  • statusstringrequired

    partial (query): an answer, but not all of what was asked.

    runningcompletedpartialfailed

  • methodobject

    The method and the version that ran.

    Show child attributes
    • idstring
    • slugstring or null
    • versioninteger
    • latest_versioninteger

      POST /v1/runs: the method’s newest version.

  • dataJSON value

    The result, shaped by the method’s output_schema (query: by your output_schema when you send one).

  • noticestring

    A completed run that came back empty or incomplete while the version is under repair: it cost nothing, and when the repair is back at the latest.

  • emptyboolean

    The site answered and has nothing for this input (still a success).

  • rawJSON value

    With include_raw: the site’s own response.

  • truncatedboolean

    The answer is not complete: the site had more than the run could read, or the output was over 10 MB and its longest list was cut. missing says what.

  • missingarray of string

    What the answer lacks, in plain words (a source that failed, items that could not be read, pages not read). Only when something is.

  • costobject
    Show child attributes
    • creditsinteger
  • duration_msinteger
  • sourcestring

    query: methods answered, or a live web search did.

    methodslive

  • stepsarray of object

    query: the method calls made (method: id, slug and the version that ran) and their status.

  • sourcesarray of object

    query, live answers: the pages the data came from.

  • uncoveredarray of string

    query: the things asked for that no method provides yet, answered from the live web beside the method calls.

  • created_atstring

    running only.

Run a method or a query

Two ways to run. With method (manual): runs that method with inputs that fit its input_schema (1 credit). With query (auto): Fous finds read methods, fills their inputs, runs up to three and returns the data, shaped by output_schema when you send one; when no method fits, it answers from the live web (source "live", sources named). A query costs 5 credits, nothing when it has no answer (404 not_found with run_id); status is partial when not all of what was asked was found; one the request check turns away answers 422 request_refused. Both wait up to wait seconds (default 30). A run still going then answers 202 with status "running" and goes on: read it with GET /v1/runs/{id}, or stop it with POST /v1/runs/{id}/cancel (nothing is charged). A query ends within 3 minutes. Hanging up before any answer stops a query; after a 202 it goes on.

Request body

Required, JSON. One of:

Run a method

  • methodstringrequired

    The method’s id (mth_…) or slug (<domain>/<name>); add @N to run version N instead of the one your organization uses (its first run sets it).

  • inputobject

    Fits the method’s input_schema; an input sent as null counts as not sent.

  • connectionstring

    A conn_ id, when the method needs an account and you want one other than the default.

  • include_rawboolean

    Also return the site’s own response as raw.

  • waitinteger

    Seconds to wait for the answer, 0 to 60 (default 30); a longer run answers 202 and goes on.

Send a query

  • querystringrequired

    The data you want, in plain words.

  • output_schemaobject

    A JSON Schema object (type object) for the answer’s shape.

  • platformstring

    Limit it to one site.

  • waitinteger

    Seconds to wait for the answer, 0 to 60 (default 30); a longer query answers 202 and goes on.

Returns

A Run object.

  • 200Completed (data may be empty: true when the site has nothing).
  • 202Still running. The same Run, with status "running".

Errors

StatusCodeWhen
400invalid_requestBoth or neither of method and query, a body that does not fit, or an output_schema that is not an object
402insufficient_creditsNot enough credits
403connection_requiredThe method needs a connected account
404not_foundNo such method or version, or a query that found no answer (with run_id and steps)
422invalid_inputrequest_refusedThe input does not fit (invalid_input), or the request check turned a query away (request_refused)
429rate_limitedToo many requests
503method_repairingupstream_errorupstream_blockedupstream_timeoutservice_unavailableThe site failed, refused the request or did not answer in time (upstream_error, upstream_blocked, upstream_timeout), the version is under repair (method_repairing, with Retry-After), or billing is briefly unavailable (service_unavailable)

Get a run

Status and result of a run (a method’s or a query’s), kept 24 hours. Free. A failed run answers with its own status and error, which carries run_id (and for a query its steps).

Path parameters

  • idstringrequired

Query parameters

  • waitintegerdefault 0

    Seconds to hold the answer while it is still running, 0 to 60.

Returns

A Run object.

  • 200Finished.
  • 202Still running. The same Run, with status "running".

Errors

StatusCodeWhen
403connection_requiredThe run needed a connected account
404not_foundUnknown or expired, or a query that found no answer (with its run_id)
409conflictThe run was stopped (reason stopped)
422invalid_inputThe site refused the input
503upstream_errorupstream_blockedupstream_timeoutmethod_unavailableThe site failed, refused the request or did not answer in time (upstream_error, upstream_blocked, upstream_timeout), or the method is broken (method_unavailable)

Cancel a run

Cancels a run (a method’s or a query’s) that is still going: nothing is charged, reading it afterwards answers 409 conflict with reason "stopped", and what the site answers after that is dropped. Free.

Path parameters

  • idstringrequired

Returns

  • 200Stopped.

The answer has these fields:

  • idstring
  • stoppedboolean

Errors

StatusCodeWhen
404not_foundUnknown or expired
409conflictAlready ended