Screenshot API SDKs and Code Examples

Screenshot API code examples by language and framework: official SDKs for Node.js, Python, Ruby, PHP, Go and Java, plus raw HTTP guides.

By Simon Chiu · Updated

This section shows how to call the RenderScreenshot API from your language or framework. Each page gives a complete example that captures a page, saves the image and handles errors.

Official SDKs or raw HTTP

We publish official SDKs for six languages. Each SDK has a reference page in the docs:

Use an SDK when one exists for your stack. It builds the request, signs URLs and turns API errors into exceptions. You do not need an SDK, though. The API is plain HTTPS, so any HTTP client works. Send a POST with a JSON body (POST endpoint) or a GET with query parameters (GET endpoint).

How to choose a page

  • Server-side code. Pick the page for your language. Framework pages (for example Laravel or Next.js) show where the call goes in that framework and how to cache the result.
  • Images in HTML or emails. Use a signed URL so the browser loads the image without your secret key.
  • Many URLs at once. Use the batch endpoint instead of a loop.

Before you start

Read the quick start for the shape of a request and a response. Then get a free API key to run the examples. No credit card is needed.

Related in this topic

Try RenderScreenshot free

150 free credits every month, no credit card required.