<?php $url = 'http://rest7.com/html_to_image'; $data = json_decode(file_get_contents('http://api.rest7.com/v1/html_to_image.php?url=' . $url . '&format=jpg')); if (@$data->success !== 1) { die('Failed'); } $image = file_get_contents($data->file); file_put_contents('rendered_page.jpg', $image);