GrabzIt
Tools to Capture and Convert the Web

Webpage to Icon API - Create an Image Icon with GrabzIt

Warning At least a Entry Package is required to use convert web pages to icons. Try it for free with a 7 day free trial. Then from $5.99 a month, unless cancelled.Start 7 Day Free Trial

The Webpage to Icon API converts URL's into icons, just try this demo to see it in action. The Webpage to Icon API is not simply a favicon finder, but instead bases the final icon on all the available icons for the webpage. If no icons are available it will generate one for the webpage. The source icon chosen, the background and any border selected can change depending on the users requirements.

To get started with the API replace the APPLICATION KEY text example in the below call with your application key then set the size parameter, which defaults to 32. Finally specify the webpage that you want to turn into an icon, by passing the required URL to the URL parameter. In the following example http://www.google.com is being converted into a 48x48 pixel icon.

//api.grabz.it/services/icon.ashx?key=APPLICATION KEY&size=48&url=http://www.google.com
A URL parameter containing & or ? characters must be URL encoded.

It is a good idea to keep the url parameter as the last parameter in the querystring as this avoids having to URL encode most URLs passed to the Webpage to Icon API.

While the Icon can be downloaded this with a server side language such as PHP. It can also be displayed directly in a web page as shown below. Remember that when using the Icon API in a webpage the domain of the webpage must be added to the list of authorized domains.

<img src="//api.grabz.it/services/icon.ashx?key=APPLICATION KEY&size=48&url=http://www.google.com"/>

An icon can also be transformed just pass the transform you want to apply from the options below. An example of which can be seen here were the transform makes the resulting icon sepia.

//api.grabz.it/services/icon.ashx?key=APPLICATION KEY&transform=sepia&size=48&url=http://www.google.com

Parameters

The Webpage to Icon API accepts the following four parameters.

Name Description Options
key Your Application Key This parameter is required to create an image icon
url The url of the webpage to convert into a icon This parameter is required to create an image icon
size The size of the resulting square icon So 32 would result in a 32x32px icon
transform The transform to apply to the resulting icon.
The default is none.
blackandwhite - create a black and white icon
grayscale - create a grayscale icon
inverse - invert the colors of the icon
inverse - create a sepia colored icon
source Define the preferred source of icons used in
generating the finished icon.
The default is all.
all - use all types of icon
favicon - only use favicons
metadata - only use the webpage metadata icons

Errors

The Webpage to Icon API can return the following error codes.

Code Description
100 No URL Specified
103 Missing Application Key
104 Unrecognized Application Key
401 The domain this API is being used on must be authorized.
500 A upgrade is required