Go

Screenshot API for Go

One net/http call. No chromedp, no cgo, no browser lifecycle inside your binary.

screenshot api go · request and resultPAGECAPTURE / 01
Go
package capture

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

func Take(url string) ([]byte, error) {
    payload, _ := json.Marshal(map[string]any{
        "url":       url,
        "format":    "png",
        "full_page": true,
    })

    req, _ := http.NewRequest("POST", "https://api.pagecapture.dev/v1/take", bytes.NewReader(payload))
    req.Header.Set("X-Access-Key", os.Getenv("PAGECAPTURE_KEY"))
    req.Header.Set("Content-Type", "application/json")

    res, err := http.DefaultClient.Do(req)
    if err != nil {
        return nil, err
    }
    defer res.Body.Close()

    body, _ := io.ReadAll(res.Body)
    if res.StatusCode != http.StatusOK {
        var apiErr struct {
            Code    string `json:"error_code"`
            Message string `json:"error_message"`
        }
        json.Unmarshal(body, &apiErr)
        return nil, fmt.Errorf("%s: %s", apiErr.Code, apiErr.Message)
    }

    return body, nil
}
Capture result
succeeded
https://example.com
Noma
Shop now
NEW COLLECTION

Objects for slower mornings.

Thoughtful essentials, made in small batches from natural materials.

Explore the collection
No. 01 · Hinoki
PLANT-BASEDMADE IN SMALL BATCHESREFILLABLE
Artifact
PNG · 1440×900
Billing
1 credit
Engine
stable

Standard library only

net/http and encoding/json. Nothing to vendor.

Static binary preserved

No cgo, no browser dependency, no runtime download.

Concurrency that fits

Rate-limit headers on every response make a token-bucket client straightforward.

Stable error codes

Easy to map onto typed sentinel errors.

Pricing

One credit per successful capture. Failures and cache hits are free.

Free
$0
100 credits
Basic
$10
2,000 credits
Growth
$47
10,000 credits
All plans

Questions this raises

How do I respect the rate limit?

Read X-RateLimit-Remaining and X-RateLimit-Reset from every authenticated response and pace accordingly. A rate-limited response always carries Retry-After.

Is there a Go SDK?

The API is plain HTTP and this snippet is the whole client. The OpenAPI document is published if you prefer to generate one.

Can I stream the result?

Yes — the body is the file, so you can copy it straight into an io.Writer instead of buffering.