You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ec3a701
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: changelog.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,16 @@ Always improving. Updates to HTML/CSS to Image are posted here.
16
16
17
17
If you have feature requests, please send them to us: support@htmlcsstoimage.com.
18
18
19
+
### Official Go client
20
+
September 15, 2026
21
+
{: .text-delta}
22
+
23
+
The official HTML/CSS to Image Go client is now available for Go 1.21+. It provides typed requests and responses for HTML/CSS images, URL screenshots, and templates, plus helpers for Google Fonts, PDF options, batches, image deletion, resizing and cropping, and signed URLs.
24
+
25
+
Install it with `go get github.com/htmlcsstoimage/go-client`. See the [Go examples](/example-code/go/), [client repository](https://github.com/htmlcsstoimage/go-client), and [package documentation on pkg.go.dev](https://pkg.go.dev/github.com/htmlcsstoimage/go-client).
Copy file name to clipboardExpand all lines: example-code/go.md
+88-37Lines changed: 88 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,52 +6,103 @@ parent: Example code
6
6
permalink: /example-code/go/
7
7
description: >-
8
8
Convert HTML to an image (png, jpg or webp) with Go + the HTML/CSS to Image
9
-
API. Renders exactly like Google Chrome.
9
+
API. Official Go client for Go 1.21+.
10
10
---
11
-
{% include intro.md language="GoLang" %}
11
+
{% include intro.md language="Go" %}
12
+
13
+
## Official Go client
14
+
15
+
For typed requests, responses, and signed URL helpers, use the official [`github.com/htmlcsstoimage/go-client`](https://pkg.go.dev/github.com/htmlcsstoimage/go-client) module. Requires Go 1.21 or newer.
The module's package name is `hcti`. Alternatively, use `hcti.NewClientFromEnv()` to load `HCTI_API_ID` and `HCTI_API_KEY`; it returns a client and an error. Optional request fields use pointers: `hcti.Ptr(false)`, `hcti.Ptr(0)`, and `hcti.Ptr("")` send explicit values, while nil leaves the field unspecified.
48
+
49
+
The client also supports URL screenshots, PDF options, templates, batches, image deletion, resizing and cropping, and signed URLs. See the [Go client repository](https://github.com/htmlcsstoimage/go-client) for usage and runnable examples, and the [package documentation on pkg.go.dev](https://pkg.go.dev/github.com/htmlcsstoimage/go-client) for the API reference.
50
+
51
+
<hr>
52
+
53
+
## Direct HTTP example
54
+
55
+
You can also call the API directly using Go's standard library:
0 commit comments