The Da Button Factory API lets you dynamically generate buttons. It returns an image in response to a URL. The URL format is the following:
Parameters are separated using the ampersand character (&). You can specify as many parameters as you like, in any order. For example, the API returns the following button in response to the URL below:
The online button designer uses this API behind the hood. While using the editor, you can see the current button URL in the text field below it.
A Size value is an integer in range 0-2000 (inclusive). All the sizes are in pixels (even the font size).
A Color value is either:
Each parameter has a long and a short name, usable indifferently. The long name is more explicit, but the short one -obviously- takes less characters.
Don't forget to URL-encode the parameters values.
| Long name | Short name | Description | Possible values/format | Default value |
|---|---|---|---|---|
| text | t | Text of the button | a string (UTF-8 encoded) | none (no text) |
| font | f | Text font |
| sans-serif |
| text-color | tc | Color of the text | a Color | black |
| text-size | ts | Size of the text | a Size | 12 |
| text-shadow-spacing | tshs | Space between the text and its shadow | a Size | 0 (no shadow) |
| text-shadow-color | tshc | Color of the shadow | a Color | #777 |
| corners | c | Radius of the button corners | a Size, or the special value round | 0 (rectangular) |
| bg-type | bgt | Type of the background coloration |
| unicolored |
| bg-color | bgc | Color of the whole background if unicolored, or the color of the top | a Color | #00f |
| end-bg-color | ebgc | Color of the bottom of the background if two-colors or gradient, or the central color if pyramid | a Color | #0ff |
| border-size | bs | Size of the border | a Size | 0 (no border) |
| border-color | bc | Color of the border | a Color | #888 |
| shadow-size | shs | Size of the button shadow | a Size | 0 (no shadow) |
| shadow-color | shc | Color of the shadow | a Color | #666 |
| shadow-orient | sho | Orientation of the shadow |
| se (south east) |
| bubble-effect | be | Draw a shiny ellipse on top of the button | 0 or 1 | 0 (no bubble effect) |
| hpadding | hp | Space between the text and the button left/right extremities (not counting the border and/or shadow size) | a Size | 12 |
| vpadding | vp | Space between the text and the button top/bottom extremities (not counting the border and/or shadow size) | a Size | 10 |
| width | w | Total width of the button. Overwrites hpadding | a Size | none |
| height | h | Total height of the button. Overwrites vpadding | a Size | none |
| type | it | Filetype of the generated image |
| png |
The HTTP response code is:
The response body is the image data if the creation was successful, or a text/plain message giving details about the error otherwise.
The largest possible area for a button is 76_800 pixels (that's 320x240). Any size parameter must be below 0 and 2000 (inclusive).
At least 10 queries every 4 seconds are allowed for a client. There is no limit on the total number or API calls per day.
You CAN directly link to a button URL on a website. Frequently accessed buttons are cached on RAM, so don't worry about speed.
However, we reserve ourselves the right to block any use that we regard as abusive. Contact us if you think you will generate several requests by second.