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

> Get Deep Search results by task ID.

# Get Discovery Task Results

## Overview

This endpoint returns paginated Deep Search results for a task.
Results can be read while the task is running or after it completes.

## Example request

```bash theme={null}
export EXTRUCT_API_TOKEN="YOUR_API_TOKEN"
export TASK_ID="YOUR_TASK_ID"

curl --get "https://api.extruct.ai/v1/discovery_tasks/${TASK_ID}/results" \
  -H "Authorization: Bearer ${EXTRUCT_API_TOKEN}" \
  --data-urlencode "offset=0" \
  --data-urlencode "limit=50"
```

## Key parameters

* `task_id` (required): Task identifier.
* `offset` (optional): Pagination offset.
* `limit` (optional): Page size.

Results are ordered by `relevance` descending.

## Endpoint behavior

* `relevance` controls the overall ordering of the result list.
* `scores` shows the grade and explanation for each criterion. If you did not provide `criteria` when creating the task, Deep Search generates them automatically.
* Use this endpoint to review companies. Use [Get Task](/api-reference/discover/get-company-discovery-task) for progress and completion state.

## Success signal

A successful response includes `results[]` with criterion `scores` details. Continue paging until returned rows are fewer than `limit`.

Use task completion rules from task status endpoint: `status=done` or `is_exhausted=true`.

## Common errors

### `401 Unauthorized`

Check that your header is `Authorization: Bearer ${EXTRUCT_API_TOKEN}`.

### `404 Not Found`

The task ID is invalid or unavailable in your workspace. Re-check `TASK_ID` from create-task response.

## Related endpoints

* [Get Task Endpoint](/api-reference/discover/get-company-discovery-task)

## Related guides

* [Deep Search](/api-guides/search/deep-search)


## OpenAPI

````yaml get /v1/discovery_tasks/{task_id}/results
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /v1/discovery_tasks/{task_id}/results:
    get:
      tags:
        - company-discovery
      summary: Get Discovery Task Results
      operationId: get_discovery_task_results_v1_discovery_tasks__task_id__results_get
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
        - name: offset
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
        - name: limit
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscoveryTaskResultsOutput'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    DiscoveryTaskResultsOutput:
      properties:
        id:
          type: string
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
        status:
          $ref: '#/components/schemas/Status'
        query:
          type: string
          title: Query
        is_exhausted:
          type: boolean
          title: Is Exhausted
          default: false
        desired_num_results:
          type: integer
          title: Desired Num Results
        num_results_discovered:
          type: integer
          title: Num Results Discovered
          description: Total number of company candidates discovered from search
          default: 0
        num_results_enriched:
          type: integer
          title: Num Results Enriched
          description: Number of candidates enriched with company profiles
          default: 0
        num_results_evaluated:
          type: integer
          title: Num Results Evaluated
          description: Number of candidates that had criteria evaluation completed
          default: 0
        num_results:
          type: integer
          title: Num Results
          description: Total number of results
          default: 0
        table_id:
          anyOf:
            - type: string
            - type: 'null'
        auto_data_sources:
          type: boolean
          title: Auto Data Sources
          default: true
        data_sources:
          anyOf:
            - items:
                $ref: '#/components/schemas/DiscoveryDataSource'
              type: array
            - type: 'null'
        criteria:
          anyOf:
            - items:
                $ref: '#/components/schemas/CriterionDefinition'
              type: array
            - type: 'null'
        exclude_domains:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Exclude Domains
          description: >-
            The resolved, sorted list of registered domains that were excluded
            from this run.
        results:
          items:
            $ref: '#/components/schemas/DiscoveryTaskResultOutput'
          type: array
          title: Results
      type: object
      required:
        - id
        - created_at
        - status
        - query
        - desired_num_results
        - results
      title: DiscoveryTaskResultsOutput
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Status:
      type: string
      enum:
        - created
        - in_progress
        - done
        - failed
      title: Status
    DiscoveryDataSource:
      type: string
      enum:
        - web_search
        - linkedin
        - maps
      title: DiscoveryDataSource
    CriterionDefinition:
      properties:
        key:
          type: string
          pattern: ^[a-zA-Z][a-zA-Z0-9_]*$
          title: Key
          description: Unique identifier for this criterion (e.g., "is_ai_company")
        name:
          type: string
          maxLength: 100
          minLength: 1
          title: Name
          description: Human-readable name for this criterion (e.g., "AI Company")
        criterion:
          type: string
          maxLength: 500
          minLength: 10
          title: Criterion
          description: The actual criterion text to evaluate against companies
      type: object
      required:
        - key
        - name
        - criterion
      title: CriterionDefinition
      description: Definition of a criterion for evaluating companies in discovery tasks
    DiscoveryTaskResultOutput:
      properties:
        id:
          type: string
          title: Id
        task_id:
          type: string
          title: Task Id
        created_at:
          type: string
          format: date-time
          title: Created At
        company_name:
          type: string
          title: Company Name
        company_description:
          type: string
          title: Company Description
        company_website:
          type: string
          title: Company Website
        company_profile_id:
          anyOf:
            - type: string
            - type: 'null'
          description: UUID of the linked company profile in the global index
        source:
          $ref: '#/components/schemas/DiscoveryDataSource'
          description: >-
            Data source where this company was discovered (WEB_SEARCH, LINKEDIN,
            etc.)
          default: web_search
        relevance:
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            Relevance score (0-100 scale). When criteria scores exist, this is
            computed from them.
        scores:
          anyOf:
            - additionalProperties:
                $ref: '#/components/schemas/CriterionScore'
              type: object
            - type: 'null'
          description: Evaluation scores for each criterion defined in the discovery task
        founding_year:
          anyOf:
            - type: integer
            - type: 'null'
          description: Year the company was founded (from company profile)
        employee_count:
          anyOf:
            - $ref: '#/components/schemas/CompanySize'
            - type: 'null'
          description: >-
            Employee size bucket using LinkedIn-style ranges (e.g., SIZE_1_10,
            SIZE_51_200, SIZE_10000_PLUS)
        hq_country:
          anyOf:
            - type: string
            - type: 'null'
          description: Headquarters country (from company profile)
        hq_state_province:
          anyOf:
            - type: string
            - type: 'null'
          description: Headquarters state or province (from company profile)
        hq_city:
          anyOf:
            - type: string
            - type: 'null'
          description: Headquarters city (from company profile)
        company_full_description:
          anyOf:
            - type: string
            - type: 'null'
          description: Full description of the company (from company profile)
      type: object
      required:
        - id
        - task_id
        - company_name
        - company_description
        - company_website
        - relevance
      title: DiscoveryTaskResultOutput
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    CriterionScore:
      properties:
        grade:
          anyOf:
            - type: integer
              maximum: 5
              minimum: 1
            - type: 'null'
          description: >-
            Evaluation score on 1-5 scale (1=weak match, 5=strong match), None
            if evaluation failed
        explanation:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          description: Explanation of why this grade was assigned
        sources:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: URLs or references that support this evaluation
      type: object
      title: CriterionScore
      description: Score result from evaluating a criterion
    CompanySize:
      type: string
      enum:
        - 1-10
        - 11-50
        - 51-200
        - 201-500
        - 501-1000
        - 1001-5000
        - 5001-10000
        - 10001+
      title: CompanySize
      description: Employee headcount buckets using LinkedIn-style ranges.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````