> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nimbleway.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Research

> **WebRouter is in closed beta.** It's available to selected accounts, and the API may still change. To get access, [talk to the Nimble team](https://nimbleway.com/contact-general/).

Where a research run stands, in `result`, with its answer in `result.response` once `state` is 'completed'; `meta` names the tool. Pass `wait=60`, so one call waits up to a minute for the run to end, and call again only while `state` is 'queued' or 'running'; it then ends 'completed', 'failed' or 'cancelled'. Polling starts nothing new: poll rather than start the research again. A 410 means the provider no longer knows the run: how long an ended run stays readable depends on the provider, so read its answer soon after it completes, and start a new run only if the answer is still needed. A 502 or 504 means the provider did not answer this poll, not that the run failed: it goes on, so poll again.



## OpenAPI

````yaml /api-reference/web-router-openapi.json get /v2/web-router/research/{job_id}
openapi: 3.1.0
info:
  title: WebRouter API
  version: 1.0.0
  description: >-
    Closed beta. One API to search, extract, research and browse the web, on
    Nimble or any provider your account may use. `route` picks the tool and
    provider for a query and runs it in one call. Search and extract answer
    within the call. Research and browse are jobs: start one, then poll it by
    `job_id` until `state` is `completed`, `failed` or `cancelled`. Authenticate
    with `Authorization: Bearer YOUR_API_KEY`.
servers:
  - url: https://sdk.nimbleway.com
security: []
paths:
  /v2/web-router/research/{job_id}:
    get:
      tags:
        - WebRouter
      summary: Get Research
      description: >-
        **WebRouter is in closed beta.** It's available to selected accounts,
        and the API may still change. To get access, [talk to the Nimble
        team](https://nimbleway.com/contact-general/).


        Where a research run stands, in `result`, with its answer in
        `result.response` once `state` is 'completed'; `meta` names the tool.
        Pass `wait=60`, so one call waits up to a minute for the run to end, and
        call again only while `state` is 'queued' or 'running'; it then ends
        'completed', 'failed' or 'cancelled'. Polling starts nothing new: poll
        rather than start the research again. A 410 means the provider no longer
        knows the run: how long an ended run stays readable depends on the
        provider, so read its answer soon after it completes, and start a new
        run only if the answer is still needed. A 502 or 504 means the provider
        did not answer this poll, not that the run failed: it goes on, so poll
        again.
      operationId: poll_research
      parameters:
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            examples:
              - wgrj_00000000000000000000000000000000
            title: Job Id
          description: 'The run''s id: the `job_id` its start answered with.'
        - name: wait
          in: query
          required: false
          schema:
            type: number
            maximum: 60
            minimum: 0
            description: >-
              Pass 60: seconds to wait for the job to end before answering,
              polling its provider meanwhile, so one call waits up to a minute.
              0 asks once. The answer comes within this and 35 s more.
            default: 0
            title: Wait
          description: >-
            Pass 60: seconds to wait for the job to end before answering,
            polling its provider meanwhile, so one call waits up to a minute. 0
            asks once. The answer comes within this and 35 s more.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResearchJobResponse'
        '401':
          description: Missing or invalid API key, or Nimble refused your account.
        '402':
          description: 'Nimble refused your account: out of credits.'
        '403':
          description: Nimble refused your account, or WebRouter is not enabled for it.
        '404':
          description: No job of your account has that id.
        '410':
          description: >-
            The provider no longer knows the job: it ended there long ago, or
            the key it started on changed (`gone_at_provider`).
        '422':
          description: The job id is invalid.
        '502':
          description: 'The provider did not answer this poll. The job goes on: poll again.'
        '503':
          description: Your account's settings could not be read.
        '504':
          description: 'The provider did not answer this poll. The job goes on: poll again.'
      security:
        - BearerAuth: []
components:
  schemas:
    ResearchJobResponse:
      properties:
        meta:
          $ref: '#/components/schemas/ToolMeta'
          description: The tool that ran.
        result:
          $ref: '#/components/schemas/ResearchProgress'
          description: Where the run stands, and its answer once it has one.
      type: object
      required:
        - meta
        - result
      title: ResearchJobResponse
    ToolMeta:
      properties:
        tool:
          $ref: '#/components/schemas/Tool'
          description: The tool that ran.
      type: object
      required:
        - tool
      title: ToolMeta
    ResearchProgress:
      properties:
        job_id:
          type: string
          title: Job Id
          description: 'The job''s id: poll it and cancel it with this.'
          examples:
            - wgrj_00000000000000000000000000000000
        provider:
          type: string
          title: Provider
          description: >-
            `nimble_selection` when Nimble picked and served the call. The
            provider's name when your own key served it, with `byok` true.
          examples:
            - nimble_selection
        byok:
          type: boolean
          title: Byok
          description: Whether your own provider key served the call.
        state:
          type: string
          enum:
            - queued
            - running
            - completed
            - failed
            - cancelled
          title: State
          description: >-
            'queued' or 'running' while it works; 'completed', 'failed' or
            'cancelled' once it stopped, for good.
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
          description: >-
            What the provider said of the state, such as why the job failed.
            Only for a job on Nimble.
        response:
          anyOf:
            - $ref: '#/components/schemas/ResearchResponse'
            - type: 'null'
          description: The answer. Set exactly when `state` is 'completed'.
        job_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Job Url
          description: >-
            The job's path on the server. Poll the job by its `job_id` at `GET
            /v2/web-router/research/{job_id}` or `GET
            /v2/web-router/browse/{job_id}`.
      type: object
      required:
        - job_id
        - provider
        - byok
        - state
      title: ResearchProgress
      description: Where one research run stands, and its answer once it has one.
    Tool:
      type: string
      enum:
        - search
        - extract
        - extract_template
        - browse
        - research
        - answer
      title: Tool
    ResearchResponse:
      properties:
        provider:
          type: string
          title: Provider
          description: >-
            `nimble_selection` when Nimble picked and served the call. The
            provider's name when your own key served it, with `byok` true.
          examples:
            - nimble_selection
        byok:
          type: boolean
          title: Byok
          description: Whether your own provider key served the call.
        answer:
          anyOf:
            - type: string
            - type: 'null'
          title: Answer
          description: The prose answer, when the run produced one.
        structured:
          anyOf:
            - additionalProperties: true
              type: object
            - items:
                anyOf:
                  - additionalProperties: true
                    type: object
                  - type: array
                  - type: string
                  - type: number
                  - type: boolean
                  - type: 'null'
              type: array
            - type: 'null'
          title: Structured
          description: The structured answer, conforming to the schema that was asked for.
        citations:
          items:
            $ref: '#/components/schemas/Citation'
          type: array
          title: Citations
          description: The sources the answer rests on.
        outcome:
          type: string
          enum:
            - complete
            - partial
          title: Outcome
          description: Whether the provider finished the work or said it stopped early.
          default: complete
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
          description: >-
            The provider's own id for the run. Only when your own key served the
            call.
      type: object
      required:
        - provider
        - byok
      title: ResearchResponse
      description: A finished research run's answer.
    Citation:
      properties:
        url:
          type: string
          title: Url
        title:
          type: string
          title: Title
          description: The cited page's title, when the provider returned one.
          default: ''
        snippet:
          type: string
          title: Snippet
          description: The passage the provider quoted from the page, when it quoted one.
          default: ''
        field:
          anyOf:
            - type: string
            - type: 'null'
          title: Field
          description: >-
            Which part of the answer this source backs -- a JSON path into
            `structured`, or a marker in `answer` (such as `[2]`) -- when the
            provider attributes per field. Null when it ties the source to no
            part of it.
        extra:
          additionalProperties: true
          type: object
          title: Extra
          description: Provider-specific fields with no normalized equivalent.
      additionalProperties: false
      type: object
      required:
        - url
      title: Citation
      description: A source the answer rests on.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.