Skip to main content
A campaign is a fundraiser. It has a name, a story, images, and usually a goal. People create campaigns on donate.gg; the API reads them. A campaign is also a beneficiary: you can name one in a config like a charity, with "type": "campaign". Every call on this page is public and on https://api.donate.gg/api/v2. The examples use a real campaign, cmr2icrm701xu04jxvybvmgwn.

Where a campaign comes from

Each campaign has a source: An imported campaign’s goal is null because the provider’s goal counts support Donate does not see. stats on any campaign is what was raised through Donate. More providers can be added, so treat a source you do not know as an imported campaign.
Campaign imports from Tiltify are not open in production yet. Until they are, source=tiltify returns an empty list there.

List campaigns

GET /v2/campaigns returns the visible, active campaigns.
The answer is { "items": [...], "nextCursor": ... }. One item, as an example:
What to get right when you show a card:
  • The goal and the total use the same unit. goalUsdE6 and stats.totalUsdE6 are both US dollars times 10^6 in a string: "10000000000" is $10,000 and `"13999894404"` is $13,999.89. Divide one by the other for a progress bar, with a big integer type.
  • imageUrl is the image for a card. media holds every image and video. An item of type image has the image at url; an item of type video has a page that plays the video at url.
  • url is the campaign’s page on donate.gg. Linking to it is welcome.
Pagination and formats explains nextCursor.

Show one campaign

GET /v2/campaigns/{campaignId} returns everything in a list item, plus the story as plain text in description.
  • stats is in the answer. Read the campaign again to refresh its total; there is no separate route for it.
  • eligible is true when the campaign can be named in a new config. A list item has it too: an active campaign is listed before its recipients can be paid, with eligible: false.
  • A completed campaign stays readable, with status: "completed" and eligible: false. It is no longer in the list.
  • A hidden campaign answers 200 with available: false and a stand-in to show in its place: the name Unavailable campaign, an image, and null or empty for everything of its own. Its messages, donations and deposit routes answer 404. Only an id that names no campaign is a 404 here.
The coin page guide has the full response and the field for each part of a details view.

Show donation messages

GET /v2/campaigns/{campaignId}/messages lists the public messages donors left, newest first.
One item, as an example. The donor’s address is a placeholder nobody holds:
  • amountAtomic is in the smallest unit of token. With decimals: 9, "13346508" is 0.013346508 SOL. amountUsdE6 is the same amount in US dollars times 10^6: "1000184" is $1.00.
  • Both amounts are this campaign’s part of the donation. When a donation went through a config that splits between several beneficiaries, you see only the part attributed to this campaign.
  • donor is the wallet that gave. name, imageUrl and url are null for a wallet nobody has named: show the address. The API sends no “Anonymous” in its place.
  • coin is set when a coin’s fees made the donation, as { "chainId", "address" }. The donor’s name is then the coin’s name.
  • status is pending or settled. unconfirmedAt is set while the chain no longer shows the donation as final; until that clears, the donation is left out of stats.
  • limit is 1 to 50 and defaults to 25. The list pages with nextCursor.
  • A page of messages is shared for a few seconds, so reading faster than every five seconds shows nothing new.
For every donation to the campaign, including the ones with no message and the ones still on their way from another chain, use GET /v2/campaigns/{campaignId}/donations. A donation’s row there has the same message, amountAtomic, token and amountUsdE6 as its message here.

Give a campaign a deposit address

A campaign can have an address a donor sends tokens to directly, with no contract call. Donate forwards what arrives as a donation to the campaign.
1

List the chains the campaign accepts

GET /v2/campaigns/{campaignId}/deposit-chains
An example answer:
A campaign that accepts no direct deposit returns an empty items.
2

Get the address for a chain

POST /v2/campaigns/{campaignId}/deposit-addresses takes the chain in the body. It is a POST because the first request for a chain creates the address.
200 means the address exists. An example, with a placeholder address:
202 means the address is being created:
Wait retryAfterSeconds, which is also the Retry-After header, and send the same request again until you get 200. Repeating the request never creates a second address, so keep the address once it is ready. Show it only for the chain you asked about.
3

Follow a deposit

When the donor has sent, look up their transaction with GET /v2/campaigns/{campaignId}/deposits/{chainId}/{transactionHash}.
An example answer:
not-detected does not prove the transfer failed, so never treat it as a reason to send again. Keep the transaction and ask again. This read keeps answering after a campaign ends or is hidden, so a donor can always follow funds already sent.
What these three can answer besides a success: The address route has its own budget on top of the normal rate limit: 10 requests a minute for one campaign and 100 an hour in all, counted per IP address. Store each address you get instead of asking for it again.

Name a campaign in a config

Use the campaign’s id with "type": "campaign":
A campaign created on donate.gg passes its share on to its own receivers, so it can count for more than one of the five receivers a config may reach. See configs and weights.

What the API does not do

  • It does not create or edit campaigns. People do that on donate.gg.
  • It does not import a Tiltify campaign from a link.
  • It does not push updates. There are no webhooks; read again when you need newer data.

Runnable sequence