ImgCake API



Audience

This documentation is designed for people familiar with any web scripting language such as PHP, Ruby, Java, C# etc, HTML and URL concepts. You should also be familiar with adding images to a webpage.


Obtaining an API and your Private Key

You can obtain your API key along with Private key from your members area. Here are quick overview on what these keys does

API Key Private key
API key uniquely identifies you and register requests you sent through to ImgCake under your account. API keys starts with letters IC Private key signs your request, you create a request token using this key and we validate this request at our end before returning any data. This key start with letters SK


So how to request a webshot

Here is what webshot request to ImgCake will look like https://www.imgcake.com/process/API_KEY/REQUEST_TOKEN/FORMAT?url=http://www.jaspreetchahal.org


And how exactly we create a request token?

Simple formulae to create a request token is shown below REQUEST_TOKEN = md5("url=http://www.jaspreetchahal.org&viewport=1248x768&fullpage=true" + PRIVATEKEY) Points to note

what other settings are available?

Parameters are case sensitive.

Lets not make it too complicated for you.

Parameter Meaning Default Value
viewport

Sets window dimensions. passed as viewport=wxh

i.e. &viewport=1024x768 etc, This is exactly equivalent to resizing your browser window.
1280x800, maximum 2400x1920, any larger value will be adjusted to default value
thumbnail_width

Constrain webshot based on width.

i.e. &thumbnail_width=500
400x400
fullpage

We will make an attempt to render full webpage.

&fullpage=true
false
accept_lang

If you would like to override default language request headers. Use W3C Internationalization Checker to check what default Accept-Language header value is for a website.

&accept_languages=en-gb;, Please url encode this value
en-US,en;q=0.8
user_agent

Pass a custom user user agent

&user_agent=value, Please url encode this value
unique

Current timestamp of your server to this parameter

&unique=2017-08-20-15-30-11
inject_css

Got a custom CSS rules, pass on reference file

&inject_css=https://www.example.com/css/example.css, Please url encode this value
Maximum 500 characters
ttl

We cache webshot for 30 days. You can override this default.

&ttl=2. If supplied ttl is greater than 30, then value is adjusted to 30
30
quality

JPEG compression quality

. Value range 20%-100%. Applies if requested image format is JPEG
100%

How about a code samples

checkout our getting started guide