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
succeededhttps://example.com
Noma
Shop nowNEW COLLECTION
Objects for slower mornings.
Thoughtful essentials, made in small batches from natural materials.
Explore the collectionOur materials
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.
Related
Screenshot API
A screenshot API that returns the file, not a job to poll
Node.js
Screenshot API for Node.js
Bulk
Capture a thousand URLs in one call
Ready to try it against your own page?
Try it free — no signup