Show your total tree count with the API
If you want to show how many trees your business has planted, the quickest way is one of our website widgets. If you’d rather build your own display, for example on a sustainability page, your system can get the number from the ReviewForest API.
How to get the number
Section titled “How to get the number”-
Create an API key. In the app, open Integrations under More in the menu on the left. On the ReviewForest public API card, click View API key, then Create new key. Read-only is enough for this. Click Create key and copy the key from the table.
-
Find your slug. That’s the last part of your forest address. If your forest is at
https://reviewforest.org/your-business, the slug isyour-business. -
Request the number. Send a
GETrequest with your key in theapikeyheader:Example with curl curl -H "apikey: YOUR_API_KEY" https://api.reviewforest.org/v1/smiirl/your-businessThe response contains the number of trees:
{ "number": 1234 }
The number covers all trees in the review forest, including additional trees you planted. For a brand forest it’s the sum of all active review forests in your account.
The key type Website-Widgets doesn’t work for this request. It’s meant for showing widgets on websites and can only read forests and widgets.