LabStack Docs
Login Signup

Webpage Image

Convert webpage to an image

Request

GET https://webpage.labstack.com/api/v1/image

Parameter Description Type Required Default
url Webpage URL String Yes
language Language locale for webpage rendering String No en-US
ttl Max number of seconds to cache the webpage Number No 604800
full_page Enables full length webpage Boolean No false
retina Enables retina display Boolean No false
width Webpage viewport width Number No 800
height Webpage viewport height Number No 600
delay Number of milliseconds to delay Number No 0
curl \
  -X GET https://webpage.labstack.com/api/v1/image?url=amazon.com \
  -H 'Authorization: Bearer <API_KEY>'
c := labstack.NewClient("<API_KEY>")
s := c.Webpage()
res, err := s.Image(&webpage.ImageRequest{
  URL: "amazon.com",
})
if err != nil {
  fmt.Println(err)
}
Client client = new Client("<API_KEY>");
WebpageService service = client.webpage();
try {
  ImageRequest request = ImageRequest.builder().url("http://amazon.com").build();
  ImageResponse response = service.image(request);
} catch (LabStackException e) {
  e.printStackTrace();
}
const client = new Client("<API_KEY>")
const service = client.webpage();
try {
  const response = await service.image({
    url: "http://twilio.com"
  });
} catch (error) {
  console.error(error);
}
client = Client("<API_KEY>")
service = client.webpage()
try:
  response = service.image({
    "url": "http://twilio.com"
  })
except LabStackError as e:
  print(e)

Response

{
  "image": "https://webpage.labstack.com/d/70b68a6382e84a814e20758479a26c20.png",
  "cached": false,
  "took": 3189,
  "generated_at": "2019-07-19T03:57:08+00:00"
}
Parameter Description Type
image Image URL String
cached Image is cached or not Boolean
took Number of milliseconds took to generate the image Number
generated_at Generated timestamp Number