# ApifyTools works with apify-client 3.x, plus YouTube and CSV fixes

> Agno ApifyTools now works with apify-client 3.x, and this release fixes YouTube search limits plus two bugs in YouTubeReader and FieldLabeledCSVReader.

- Published: 2026-11-12
- Author: John Cole
- Categories: Changelog
- Canonical: https://www.agno.com/blog/apifytools-works-with-apify-client-3-x-plus-youtube-and-csv-fixes
- Markdown: https://www.agno.com/blog/apifytools-works-with-apify-client-3-x-plus-youtube-and-csv-fixes.md

Agno `ApifyTools` now works with apify-client 3.x, which a fresh `agno[apify]` install pulls in. Before, it couldn't register a single Actor with that version. This release also fixes a zero result limit in YouTube search and two reader bugs, in `YouTubeReader` and `FieldLabeledCSVReader`. Each fix ran without a key on the earlier release and this one, and the output below is real.

## ApifyTools reads apify-client 3.x responses

apify-client 3.x returns Pydantic models where 2.x returned dicts, so the `.get("id")` calls in `ApifyTools` raised `AttributeError`. Agno now converts either shape to a dict before reading the Actor and run IDs. A real 3.x `ActorResource` went into a `MagicMock` client, with the build request mocked:

```text
# Before
AttributeError: 'ActorResource' object has no attribute 'get'

# Now
build: {'actorDefinition': {'description': 'Crawls websites.'}}
```

## SearchApiTools honors a zero YouTube limit

`SearchApiTools.search_youtube(num_results=0)` treated zero as unset and returned the toolkit's default count. It now falls back to the default only for `None`. With a default of 5 and eight videos in a mocked response:

```text
# Before
search_youtube(num_results=0): 5 videos

# Now
search_youtube(num_results=0): 0 videos
```

## YouTubeReader.async_read takes a name

`Knowledge.ainsert()` passes the reader a document `name`, and `YouTubeReader.async_read()` took only the URL, so async ingestion of a YouTube video failed. `async_read()` now accepts `name` and passes it to `read()`. A `MagicMock` stood in for the YouTube transcript API:

```text
# Before
TypeError: YouTubeReader.async_read() got an unexpected keyword argument 'name'

# Now
async_read name: Product demo
```

## FieldLabeledCSVReader reads unnamed streams

A `SpooledTemporaryFile`, which FastAPI's `UploadFile.file` often is, has a `name` of `None`, and a `TemporaryFile` on Unix has an integer one. `FieldLabeledCSVReader` called `.split(".")` on that name, caught the error and returned nothing. It now falls back to `csv_file` for any name that is not a string.

```text
# Before
SpooledTemporaryFile: 0 documents

# Now
SpooledTemporaryFile: 2 documents ['csv_file_row_1', 'csv_file_row_2']
```

See the [Apify tools cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/91_tools/apify_tools.py), and learn more about [Apify](https://docs.agno.com/tools/toolkits/others/apify), [SearchApi](https://docs.agno.com/tools/toolkits/search/searchapi), the [YouTube reader](https://docs.agno.com/knowledge/concepts/readers/youtube-reader) and the [CSV reader](https://docs.agno.com/knowledge/concepts/readers/csv-reader) in the documentation.
