Actor in Go example
by jirimoravcik
A practical, open-source template actor written in Go. Use it as a blueprint to build and deploy your own web scrapers and automation tasks on Apify.
Opens on Apify.com
About Actor in Go example
Need a clean, straightforward example of how to build a web scraper or automation task with Go? This actor is exactly that. It's not a bloated framework or an over-engineered solution—it's a practical, well-commented template written in Go. I use it as a reference point when I'm starting a new project on the Apify platform, because it shows you the proper structure, how to handle requests, and how to manage data flow the "Apify way" using the Go SDK. It demystifies the process of turning Go code into a scalable, hosted actor. Whether you're looking to understand the basics of the actor model, want to see a real implementation of the Apify SDK for Go, or need a trusted foundation to modify for your own scraping job, this example has you covered. It’s open-source, so you can fork it, tweak it, and deploy it directly. Think of it as the reliable blueprint that saves you from figuring out the boilerplate from scratch.
What does this actor do?
Actor in Go example is a web scraping and automation tool available on the Apify platform. It's designed to help you extract data and automate tasks efficiently in the cloud.
Key Features
- Cloud-based execution - no local setup required
- Scalable infrastructure for large-scale operations
- API access for integration with your applications
- Built-in proxy rotation and anti-blocking measures
- Scheduled runs and webhooks for automation
How to Use
- Click "Try This Actor" to open it on Apify
- Create a free Apify account if you don't have one
- Configure the input parameters as needed
- Run the actor and download your results
Documentation
Actor in Go Example
A template for building Apify actors using Go. This example demonstrates the core structure and patterns needed to create reliable, production-ready web scraping and automation tools on the Apify platform.
Key Features
- Go-Based Foundation: Built with the official
apify/sdk-golibrary, providing a robust framework for actor development. - Structured Project Layout: Includes a standard
main.goentry point,go.modfor dependencies, and a pre-configuredDockerfilefor seamless deployment. - Platform Integration: Handles Apify-specific concerns like configuration, key-value stores, and dataset management out of the box.
- Example Logic: Contains simple, runnable code that processes input, performs a mock task (like fetching a webpage), and stores structured results.
How to Use
You can run this actor directly on the Apify platform or build and develop it locally.
On Apify Platform
- Fork this actor into your own account on the Apify platform.
- Configure the required input (see Input section below).
- Click Run to start the execution. You can monitor logs and results in the console.
Local Development
- Prerequisites: Ensure you have Go and Docker installed.
- Clone and Build:
bash git clone <repository-url> cd apify-go-actor-example go mod download - Test Locally: Use the Apify SDK's local proxy to simulate the platform environment:
bash go run main.go - Deploy: Build the Docker image and push it to your Apify actor's registry, or use the Apify CLI for deployment.
Input
Configure the actor using a JSON input object. The primary field is:
targetUrl(string, required): The starting URL for the actor's task (e.g.,"https://example.com").
Example input:
{
"targetUrl": "https://www.apify.com?fpr=python_automation"
}
Output
The actor stores its results in the default dataset associated with the run. Each item in the dataset is a JSON object containing data extracted or processed during execution.
Example output items:
{
"url": "https://www.apify.com?fpr=python_automation",
"title": "Apify - Web Scraping, Data Extraction and Automation",
"completedAt": "2023-10-26T12:00:00.000Z"
}
You can access the results via the Apify platform console, API, or by downloading them as JSON, CSV, or other formats.
Categories
Common Use Cases
Market Research
Gather competitive intelligence and market data
Lead Generation
Extract contact information for sales outreach
Price Monitoring
Track competitor pricing and product changes
Content Aggregation
Collect and organize content from multiple sources
Ready to Get Started?
Try Actor in Go example now on Apify. Free tier available with no credit card required.
Start Free TrialActor Information
- Developer
- jirimoravcik
- Pricing
- Paid
- Total Runs
- 1,452
- Active Users
- 12
Related Actors
Web Scraper
by apify
Cheerio Scraper
by apify
Website Content Crawler
by apify
Legacy PhantomJS Crawler
by apify
Apify provides a cloud platform for web scraping, data extraction, and automation. Build and run web scrapers in the cloud.
Learn more about ApifyNeed Professional Help?
Couldn't solve your problem? Hire a verified specialist on Fiverr to get it done quickly and professionally.
Trusted by millions | Money-back guarantee | 24/7 Support