2025-05-04 19:58:46 +02:00
2025-04-25 01:09:44 +02:00
2025-04-25 01:09:44 +02:00
2025-05-04 19:58:46 +02:00
2025-04-25 01:09:44 +02:00
2025-04-25 01:09:44 +02:00
2025-04-25 01:09:44 +02:00
2025-04-25 01:09:44 +02:00
2025-04-25 01:09:44 +02:00
2025-04-25 01:49:20 +02:00
2025-04-25 01:09:44 +02:00
2025-04-25 01:09:44 +02:00
2025-04-25 01:39:55 +02:00
2025-04-25 01:09:44 +02:00
2025-04-25 01:09:44 +02:00
2025-04-25 01:09:44 +02:00
2025-04-25 01:09:44 +02:00
2025-04-25 01:09:44 +02:00
2025-05-04 19:58:46 +02:00
2025-04-25 01:09:44 +02:00
2025-04-25 01:09:44 +02:00
2025-04-25 01:39:55 +02:00
2025-04-25 01:09:44 +02:00
2025-04-25 01:49:20 +02:00
2025-04-25 01:49:20 +02:00
2025-04-25 01:09:44 +02:00
2025-04-25 01:09:44 +02:00
2025-04-25 01:09:44 +02:00
2025-04-25 01:09:44 +02:00
2025-04-25 01:09:44 +02:00
2025-04-25 01:09:44 +02:00
2025-04-25 01:09:44 +02:00

Wren API Tutorial (Node.js)

This example demonstrates how to use the Wren API to:

  1. Fetch available offset projects
  2. Create a carbon offset order

Setup

  1. Install dependencies:
npm install
  1. Create a .env file with your Wren API token:
WREN_API_TOKEN=your-token-here
  1. Run the example:
npm start

API Documentation

For full API documentation, visit: https://wren.co/api

Features

  • Environment variable configuration
  • Error handling
  • Project listing
  • Order creation
  • Response parsing

Sample Output

Fetching available offset projects...
Found 3 projects:

- Direct Air Carbon Capture (Iceland)
  Price: $250/ton
  Type: Direct Air Capture

- Coastal Mangrove Restoration (Indonesia)
  Price: $150/ton
  Type: Nature-Based

- Ocean Carbon Removal (Global Oceans)
  Price: $200/ton
  Type: Ocean-Based

Creating offset order for 1 ton of CO2...

Order created successfully!
------------------------
Order ID: ord_123abc
Amount: $200
Status: completed
Portfolio: Standard Portfolio

Portfolio projects:
- Direct Air Carbon Capture
- Coastal Mangrove Restoration
Description
No description provided
Readme 157 KiB
Languages
TypeScript 43.6%
PHP 25.5%
JavaScript 24.4%
HTML 3.6%
Shell 1.8%
Other 1.1%