http://css.spritegen.com/api.php?help
The CSS Sprites Generator uses a very simple HTTP API. Simply send GET or POST requests (file uploads have to be POST of course) to this URL.
All requests except getToken require a token to be present - this is what identifies you to the system - like a session ID.
All responses are sent as UTF-8 JSON. They contain at least "message" property and an "error" property. Different requests may add other properties. If "error" is true then "message" will be the error message.
All requests may be made as many times as you like (but be reasonable!).
api.php?getToken
You can upload files using a normal HTTP POST.
The file data should be encoded the same as if it were sent from an <input type="file" name="img">
.
Files accepted are .png, .jpg, .jpeg, .gif and .zip (containing the aforementioned file types).
api.php?upload&token=...
api.php?create&token=...
There are also several optional arguments you can pass in - more options may be coming soon:
Download your sprite from the URL given in the previous step.
For example, in PHP you can simply use file_put_contents('my_file.png', file_get_contents($response['url']))