Claim your Biolink Click Here
2 like 0 dislike
125 views
I need to show the website screenshot on my website using pagepeeker api
in Education & Reference by (1.1k points) | 125 views

1 Answer

1 like 0 dislike
Best answer

make a php script

<?php

$site_url = $_GET['site_url'];
$allowedReferer = 'https://gingerbook.com'; // Replace with your own domain


// Check if the Referer header is set
if (isset($_SERVER['HTTP_REFERER'])) {
    $referer = $_SERVER['HTTP_REFERER'];

    // Check if the Referer matches the allowed domain
    if (strpos($referer, $allowedReferer) === 0) {



$url = "http://free.pagepeeker.com/v2/thumbs.php?size=l&url=" . $site_url;

$ch = curl_init();
$timeout = 0;
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);

// Getting binary data
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);

$image = curl_exec($ch);
curl_close($ch);

// output to browser
header("Content-type: image/jpeg");
echo $image;



        // Referer matches, allow access
        // Your PHP code goes here
    } else {
        // Referer does not match, show an error or redirect to an error page
        echo "Not Authorised";
        exit();
    }
} else {
    // Referer header is not set, show an error or redirect to an error page
    echo "Access denied.";
    exit();
}


// Your PHP code goes here
// ...






?> 
by (820 points)
selected by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
2 like 0 dislike
2 answers
2 like 0 dislike
1 answer
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

1,313 questions
1,475 answers
569 comments
4,809 users