get thumbnails of a website from their urls

13,440

Solution 1

Use PhantomJS to create screenshots. PhantomJS comes with an example called rasterize.js, which does exactly this. Example:

phantomjs rasterize.js http://raphaeljs.com/polar-clock.html clock.png

Docs here. Related projects including web services here.

Solution 2

http://snapit.io works well, and gives you historical caching on a CDN. For example this URL would look like

http://www.snapit.io/snaps?url=https://stackoverflow.com/questions/7907170/get-thumbnails-of-a-website-from-their-urls

if you wanted a thumbnail of 200x200 pixels (keeping aspect ratio) you could do

http://www.snapit.io/snaps?url=https://stackoverflow.com/questions/7907170/get-thumbnails-of-a-website-from-their-urls&max_width=200&max_height=200

There's a lot of other services just like this out there, most require a subscription for any substantial amount of use though (including snapit.io), http://url2png.com, http://www.shrinktheweb.com, http://www.thumbalizr.com.

Share:
13,440

Related videos on Youtube

deGee
Author by

deGee

Updated on June 17, 2022

Comments

  • deGee
    deGee almost 2 years

    I want to save the thumbnails of a website by just entering their urls , e.g if I enter http://www.google.com , it should generate the thumbnail of the google search page .

    One such API that I was using till now is http://counter2.goingup.com/thumboo/image.php. A sample url for that :

    http://counter2.goingup.com/thumboo/image.php?i=1f899e4e1abf9473ccae69de4f3ec1ca|||www.google.com|||80x50

    But , off late it's showing the error "URL not found" . Do anybody know what exacly has gone wrong with this API ?

    Is there any other such convenient third party API out there which can be of some help to me . By convenient , I mean, it should not show a lame Screenshot queued up message everytime it fails to find any pre-existent snapshot for that website in their db.

  • Nicorr
    Nicorr over 8 years
    Does not exist anymore
  • Steven2163712
    Steven2163712 over 6 years
    Any idea how to do that for a site that one is logged into?