1ClickImpact API Reference
website·Indexed 33 days ago
https://docs.1clickimpact.comTechnical specifications for the 1ClickImpact API, including authentication via x-api-key and endpoints for environmental actions such as Plant Trees, Clean Ocean, Capture Carbon, and Restore Coral. Includes utility features like Website Carbon and AI Energy, as well as methods for managing user impact records and cancellations.
What's inside 1ClickImpact
- The Website Carbon Calculator is a free tool that provides a carbon rating (A+ to F) for any URL. It calculates CO2 per page view, checks green hosting status, and provides annual impact equivalents (e.g., trees or EV km). It is based on the Sustainable Web Design Model V4.
Estimate and offset AI model energy usage
The AI Energy Calculator is a free tool to estimate electricity, water, and carbon footprints for 45+ AI models across providers like OpenAI, Anthropic, Google, and others. Users can input model, workload, region, and monthly volume to see energy (Wh), water (mL), and CO2 (gCO2e) impacts. The resulting carbon footprint can be offset via a single API call to the/v1/capture_carbonendpoint.Implement 1ClickImpact Webhooks
Webhooks allow you to receive real-time, HMAC-signed impact events (e.g.,
impact.initiated,impact.completed,impact.cancelled) instead of polling the track endpoint.Key Implementation Details:
- Deduplication: Use the
idfield in the payload envelope for deduplication; do not useX-1CI-Delivery-Idas it changes on retries. - Verification: Verify the
X-1CI-Signatureheader using the signing secret (whsec_...) from the dashboard. ComputeHMAC_SHA256(secret, t + "." + rawRequestBody)and compare it to thev1value using a constant-time check. - Response: Return a
2xxstatus code quickly to acknowledge receipt. 429 and 5xx responses will trigger retries with backoff.
// Example Webhook Payload Envelope { "id": "<tracking_id>#<type>#<occurred_at>", "type": "impact.donation_sent", "sent_at": "2026-03-19T15:27:14.753Z", "data": { "tracking_id": "U1234-2026-03-12T15:22:14.753Z", "user_id": "U1234", "occurred_at": "2026-03-19T15:22:14.753Z", "track": { ...full track response... } } }- Deduplication: Use the
Handle pagination for 1ClickImpact API records
The API uses cursor-based pagination for the
/v1/records,/v1/customer_records, and/v1/customersendpoints.- Page Size: Default is 10; maximum is 1000 using the
limitquery parameter. - Navigation: If a
cursorfield is present in the response, pass that value as thecursorquery parameter in the subsequent request to retrieve the next page. - Termination: When the
cursorfield is absent from the response, the last page has been reached. - Filtering: You can further restrict results using
start_dateandend_dateparameters inYYYY-MM-DDformat.
- Page Size: Default is 10; maximum is 1000 using the
Retrieve daily impact time-series data
UseGET /v1/impact/dailyto retrieve daily impact data for dashboards and trend analysis. You can optionally filter the results usingstart_dateandend_dateinYYYY-MM-DDformat.curl -X GET "https://api.1clickimpact.com/v1/impact/daily?start_date=2025-01-01&end_date=2025-03-01" \ -H "x-api-key: YOUR_API_KEY"Cancel and reverse an impact record
Cancel a previously created impact (e.g., for order refunds). This reverses usage billing and removes the impact from aggregate totals. This operation is idempotent.
Constraints:
- Impacts already processed (donation received by non-profit) cannot be cancelled via API.
- Requires the original
user_idandtime_utctimestamp from the record.
POST /v1/cancel_impact { "user_id": "U1234", "time_utc": "2025-03-12T15:22:14.753Z", "reason": "order refunded" }List all onboarded customers
TheGET /v1/customersendpoint lists all customers who have had impact created on their behalf. Customers are automatically onboarded when impact is created using theircustomer_email.curl -X GET "https://api.1clickimpact.com/v1/customers?limit=20" \ -H "x-api-key: YOUR_API_KEY"Browse verified environmental projects
UseGET /v1/projectsto list verified environmental projects. You can filter by project type (trees,ocean, orcarbon) and specify alocale(e.g.,en,de,es,fr,nl) to receive translated content.curl -X GET "https://api.1clickimpact.com/v1/projects?type=trees&locale=en" \ -H "x-api-key: YOUR_API_KEY"Retrieve AI energy calculation options
UseGET /v1/ai_energy/optionsto fetch the full catalog of supportedmodel_ids, providers, hardware, regions, workloads, and regimes. This endpoint should be cached and refreshed only when thedata_versionchanges.curl -X GET "https://api.1clickimpact.com/v1/ai_energy/options" \ -H "x-api-key: YOUR_API_KEY"Get aggregated lifetime impact totals
TheGET /v1/impactendpoint returns the total lifetime impact across all categories (trees, waste, carbon, coral, money). It provides a breakdown betweenuser_impact(direct) andcustomer_impact(generated on behalf of customers).curl -X GET "https://api.1clickimpact.com/v1/impact" \ -H "x-api-key: YOUR_API_KEY"Fetch detailed impact history records
TheGET /v1/recordsendpoint allows retrieval of the organization's full impact history. It supports pagination vialimitandcursor, and filtering by specific impact types using thefilter_byquery parameter (which can be repeated for multiple types).curl -X GET "https://api.1clickimpact.com/v1/records?filter_by=carbon_captured&filter_by=waste_removed&limit=50" \ -H "x-api-key: YOUR_API_KEY"Restore coral reefs via API
Fund coral reef restoration by outplanting coral fragments. The
amountis the number of fragments.Client-side calculations:
- Reef structures:
amount / 15(approx. 15 fragments per structure). - Reef area:
amount * 144 cm²oramount * 22.32 in².
POST /v1/restore_coral { "amount": 20, "customer_email": "optional@email.com", "customer_name": "Optional Name", "notify": true, "metadata": { "reef_site": "Great Barrier Reef" } }- Reef structures: