Language Integration

Web Scraping API for Go

Call AlterLab's web scraping API from Go applications using the standard net/http package. The JSON REST API integrates cleanly with Go's type system — define request and response structs, unmarshal directly, and run concurrent scraping jobs with goroutines.

Quick Start

Go
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    payload, _ := json.Marshal(map[string]string{
        "url": "https://example.com",
    })

    req, _ := http.NewRequest("POST",
        "https://alterlab.io/api/v1/scrape",
        bytes.NewBuffer(payload),
    )
    req.Header.Set("X-API-Key", "YOUR_API_KEY")
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    var result map[string]interface{}
    json.NewDecoder(resp.Body).Decode(&result)
    fmt.Println(result["content"])
}

Need an API key? Sign up free — no credit card required.

How It Works

1

Send a URL

POST any public URL to the AlterLab API with your API key. The API handles JavaScript rendering and access automatically.

2

Receive structured data

The API returns clean JSON with page content, metadata, and any structured fields you requested via an extraction schema.

3

Use in your project

Integrate the response into your Go application, database, or workflow. No scraper maintenance required.

Common Use Cases

Frequently Asked Questions

Explore All Integrations

View all SDK and tool integrations on the Integrations overview.

Responsible Use

AlterLab is designed for extracting publicly available data. Always review the terms of service for any website you access, respect robots.txt directives, and ensure your use case complies with applicable laws in your jurisdiction.

Your first scrape.
Sixty seconds.

$1 free balance. No credit card. No SDK.Just a POST request.

terminal
curl -X POST https://api.alterlab.io/v1/scrape \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "formats": ["markdown"]}'

No credit card required · Up to 5,000 free scrapes · Balance never expire

    Go Web Scraping API — AlterLab | AlterLab