Skip to content

Overview


The card builder is the best way to dynmically generated cards at scale. Whether you use it for your discord bot as welcoming or as booster or even as leaderboard the card builder is the solution. The only real limit of what you can build is your imagination.

Okay to be fair there are a few limits appart from your imagination:

  • All generated cards count towards your storage. They will auto delete after 7 days.
ElementLimit
Image10 images
Text100 text fields with up to 100 unique fonts
Discord Profile10 Discord profiles
Roblox Profile10 Roblox profiles

To build a card we first have to know what is what. There are 2 so called “Blocks” at the moment which are called “card” and “elements”.

The Card Block is used to provide information about the card itself like background and size. It looks like the following:

{
"card": {
// Card parameters here
}
}

The card parameters define basic things like:

  • Card size
  • Background Type
  • Background value

For the card background you either have the option to use a HEX color as background color or an Image. Here is an example of how the card parameters would look like:

{
"card": {
"height": "40",
"width": "145",
"bg": "https://cdn.cookie-api.com/docs/template.png", // Can be any url that returns an Image
"bg_type": "image"
},
"elements": [
// All Elements like text, image, roblox profile etc. here
]
}

The Elements Block is used to specify elements in. You will find the json structure for the elements on the element page.

{
"elements": [
// All Elements like text, image, roblox profile etc. here
]
}

Currently there are 4 element types available:


To generate a card you have to send a request to the following endpoint:

POST/api/cards/card-builder/build
Terminal window
https://api.cookie-api.com/api/cards/card-builder/build


{
"card": {
// Card parameters here
},
"elements": [
// All Elements like text, image, roblox profile etc. here
]
}

curl --location 'https://api.cookie-api.com/api/cards/card-builder/build' \
--header 'Authorization: API_Key' \
--header 'Content-Type: application/json' \
--data '
// Your card in json format here
'

Responses
{
"message": "Card successfully created!",
"success": true,
"url": "https://cards.cookie-api.com/card-builder/094866000341562/f140a163-4cd5-4b83-a06c-a28ff57ac03d.png"
}