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 grabber, 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 https://www.astropioneer.blog/ is being converted into a 48x48 pixel icon.
//api.grabz.it/services/icon?key=Sign in to view your Application Key&size=48&url=https://www.astropioneer.blog/
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?key=Sign in to view your Application Key&size=48&url=https://www.astropioneer.blog/"/>
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?key=Sign in to view your Application Key&transform=sepia&size=48&url=https://www.astropioneer.blog/
The Webpage to Icon API accepts the following four parameters.
|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.
|source||Define the preferred source of icons used in
generating the finished icon.
The default is all.
The Webpage to Icon API can return the following error codes.
|100||No URL Specified|
|103||Missing Application Key|
|104||Unrecognized Application Key|
|114||Icon Size Invalid|
|401||The domain this API is being used on must be authorized.|
|500||A upgrade is required|