This project is a boilerplate template showing how to build an Apify Actor using Rust. It provides all the necessary scaffolding β from configuration and input schema to request handling and dataset output β to help you start building Rust-based actors for web scraping or automation jobs.
Created by Bitbash, built to showcase our approach to Scraping and Automation!
If you are looking for Rust Actor Example you've just found your team β Let's Chat. ππ
The Rust Actor Example offers a ready-to-use framework for developers who prefer Rust and want to deploy their code as Apify Actors. With this template, you get input validation, dataset handling, and a clean project structure out of the box, making it easier to focus on custom logic and tasks.
- Lets you build Apify Actors using Rust instead of JavaScript or Python.
- Includes input schema and dataset export support.
- Provides a standardized project layout for cleaner code and maintainability.
- Great for high-performance scraping or tasks where Rust speed and safety matter.
| Feature | Description |
|---|---|
| Rust-based Actor Template | Full boilerplate for building Apify Actors in Rust. |
| Input Schema Validation | Automatically validate actor inputs using defined schema. |
| Dataset Export | Built-in support for pushing results to Apify datasets. |
| Modular Structure | Clean separation of config, handlers, and logic for easy extension. |
| Language-Level Safety & Performance | Benefit from Rustβs performance, concurrency, and compile-time checks over JS/Python. |
| Field Name | Field Description |
|---|---|
| url | The URL that was processed (if implemented). |
| status | Placeholder for status or result metadata. |
Note: This is just a boilerplate β youβll need to add your own logic to scrape or process data as needed.
[
{
"url": "https://example.com",
"status": "ok"
}
]
rust-actor-example/
βββ src/
β βββ main.rs
β βββ lib.rs
β βββ handlers.rs
β βββ config/
β βββ input_schema.json
βββ Cargo.toml
βββ README.md
βββ Dockerfile
- Developers comfortable with Rust who want to build Apify Actors with higher performance.
- Performance-critical scraping tasks where Rustβs speed and safety are beneficial.
- Automation workflows requiring compiled binaries rather than interpreted scripts.
- Teams that want typed, memory-safe data processing instead of dynamic languages like JS or Python.
- Learning β a good starting point for exploring how Rust integrates with Apifyβs Actor infrastructure.
Does this actor do actual scraping out of the box?
No β it's a boilerplate template. You need to add request handling and parsing logic based on your target site.
Can I push JSON data to Apify datasets?
Yes β dataset export is included; just call the appropriate method in your custom logic.
Is input validation supported?
Yes β you can define an input schema that will be validated before execution.
Why use Rust instead of JS or Python?
Rust provides performance, concurrency, and memory-safety guarantees, which can be crucial for heavy or high-frequency scraping tasks.
Primary Metric:
Rustβs performance tends to yield faster startup and execution times compared to interpreted languages.
Reliability Metric:
Compile-time safety reduces runtime errors and prevents many classes of bugs common in dynamic languages.
Efficiency Metric:
Low-overhead concurrency and efficient memory management make it suitable for large-scale scraping.
Quality Metric:
Strong typing and explicit error handling help maintain data consistency and avoid unexpected behavior in production scraping tasks.
