> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://you.com/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://you.com/docs/_mcp/server.

# Research Task Stream

GET https://api.you.com/v1/research/{task_id}/stream

Stream real-time progress for a background research task using Server-Sent Events (SSE). The stream starts with a `connected` event and closes when the task reaches a terminal status (`completed`, `failed`, or `cancelled`). To replay events after reconnecting, pass `?from_id=N` with the last event ID you received. After the stream closes, call `GET /v1/research/{task_id}` to retrieve the full `result` object.

Reference: https://you.com/docs/api-reference/research/v1-research-task-stream

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: research
  version: 1.0.0
paths:
  /v1/research/{task_id}/stream:
    get:
      operationId: streamResearchTask
      summary: Stream progress for a background research task
      description: >-
        Stream real-time progress for a background research task using
        Server-Sent Events (SSE). The stream starts with a `connected` event and
        closes when the task reaches a terminal status (`completed`, `failed`,
        or `cancelled`). To replay events after reconnecting, pass `?from_id=N`
        with the last event ID you received. After the stream closes, call `GET
        /v1/research/{task_id}` to retrieve the full `result` object.
      tags:
        - ''
      parameters:
        - name: task_id
          in: path
          description: The unique identifier of the background research task.
          required: true
          schema:
            type: string
            format: uuid
        - name: from_id
          in: query
          description: Optional event ID to replay events from after reconnecting.
          required: false
          schema:
            type: integer
            default: 0
        - name: X-API-Key
          in: header
          description: >-
            A unique API Key is required to authorize API access. [Get your API
            Key with free credits](https://you.com/platform).
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A Server-Sent Events stream of task progress updates.
          content:
            text/event-stream:
              schema:
                type: string
        '401':
          description: Unauthorized. Problems with API key.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/StreamResearchTaskRequestUnauthorizedError
        '403':
          description: Forbidden. The API key is not authorized to access this task.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StreamResearchTaskRequestForbiddenError'
        '404':
          description: Not found. The task ID does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StreamResearchTaskRequestNotFoundError'
        '500':
          description: >-
            Internal Server Error during authentication/authorization
            middleware.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/StreamResearchTaskRequestInternalServerError
servers:
  - url: https://api.you.com
    description: Production
components:
  schemas:
    StreamResearchTaskRequestUnauthorizedError:
      type: object
      properties:
        detail:
          type: string
          description: Error detail message.
      title: StreamResearchTaskRequestUnauthorizedError
    StreamResearchTaskRequestForbiddenError:
      type: object
      properties:
        detail:
          type: string
      title: StreamResearchTaskRequestForbiddenError
    StreamResearchTaskRequestNotFoundError:
      type: object
      properties:
        detail:
          type: string
      title: StreamResearchTaskRequestNotFoundError
    StreamResearchTaskRequestInternalServerError:
      type: object
      properties:
        detail:
          type: string
      title: StreamResearchTaskRequestInternalServerError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        A unique API Key is required to authorize API access. [Get your API Key
        with free credits](https://you.com/platform).

```

## Examples



**SDK Code**

```python
import requests

url = "https://api.you.com/v1/research/task_id/stream"

headers = {"X-API-Key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.you.com/v1/research/task_id/stream';
const options = {method: 'GET', headers: {'X-API-Key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.you.com/v1/research/task_id/stream"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-API-Key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.you.com/v1/research/task_id/stream")
  .header("X-API-Key", "<apiKey>")
  .asString();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.you.com/v1/research/task_id/stream");
var request = new RestRequest(Method.GET);
request.AddHeader("X-API-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-API-Key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.you.com/v1/research/task_id/stream")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```