🌱 MakeImpact Python SDK
Official Python SDK for 1ClickImpact - Easily integrate impact actions into your Python applications
📦 Installation
pip install makeimpact
# or
poetry add makeimpact
🚀 Getting Started
You'll need an API key to use this SDK. You can get your API key from the 1ClickImpact Account API Keys page.
from makeimpact import OneClickImpact, Environment
# Initialize the SDK with your API key (production environment by default)
sdk = OneClickImpact("your_api_key")
# Create environmental impact with just a few lines of code
sdk.plant_tree(amount=1)
sdk.clean_ocean(amount=5)
sdk.capture_carbon(amount=2)
sdk.restore_coral(amount=20)
🌍 Environmental Impact Actions
🌳 Plant Trees
Help combat deforestation and climate change by planting trees.
from makeimpact import OneClickImpact
sdk = OneClickImpact("your_api_key")
# Plant a single tree
sdk.plant_tree(amount=1)
# Plant trees with a specific category
sdk.plant_tree(amount=10, category="food")
# Attach custom metadata (string key/value pairs) to the impact
sdk.plant_tree(amount=1, metadata={"orderId": "A-1001", "source": "checkout"})
# Plant trees with customer tracking
sdk.plant_tree(
amount=5,
customer_email="customer@example.com",
customer_name="John Doe"
)
Note: The optional
metadataparameter is available on every impact action (plant_tree,clean_ocean,capture_carbon,donate_money,restore_coral). It accepts up to 20 string key/value pairs (keys max 40 chars, values max 500 chars). The reserved keys"gift"and"widgetID"cannot be used.
🌊 Clean Ocean Plastic
Remove plastic waste from our oceans to protect marine life.
from makeimpact import OneClickImpact
sdk = OneClickImpact("your_api_key")
# Clean 5 pounds of ocean plastic
sdk.clean_ocean(amount=5)
# Clean ocean plastic with customer tracking
sdk.clean_ocean(
amount=10,
customer_email="customer@example.com",
customer_name="John Doe"
)
♻️ Capture Carbon
Reduce greenhouse gas emissions by capturing carbon.
from makeimpact import OneClickImpact
sdk = OneClickImpact("your_api_key")
# Capture 2 pounds of carbon
sdk.capture_carbon(amount=2)
# Capture carbon with customer tracking
sdk.capture_carbon(
amount=5,
customer_email="customer@example.com",
customer_name="John Doe"
)
💰 Donate Money
Support any cause through direct monetary donations.
from makeimpact import OneClickImpact
sdk = OneClickImpact("your_api_key")
# Donate $1.00 (amount in cents)
sdk.donate_money(amount=100)
# Direct the donation to a specific cause category
sdk.donate_money(amount=100, category="veterans")
# Donate with customer tracking
sdk.donate_money(
amount=500, # $5.00
category="climate",
customer_email="customer@example.com",
customer_name="John Doe"
)
Note: To set up a custom cause for donations, please contact 1ClickImpact directly. All causes must be vetted and approved to ensure they meet their standards for transparency and impact.
🪸 Restore Coral
Rebuild damaged reefs by restoring coral fragments.
from makeimpact import OneClickImpact
sdk = OneClickImpact("your_api_key")
# Restore 20 coral fragments
sdk.restore_coral(amount=20)
# Restore coral with customer tracking
sdk.restore_coral(
amount=50,
customer_email="customer@example.com",
customer_name="John Doe"
)
❌ Cancel Impact
Cancel and reverse a previously created impact — useful for refund flows. This endpoint is idempotent: calling it again for the same impact simply returns a message that the impact was already cancelled, without reversing anything twice.
from makeimpact import OneClickImpact
sdk = OneClickImpact("your_api_key")
# Cancel an impact using the user_id and time_utc from the original record
cancellation = sdk.cancel_impact(
user_id="U1234",
time_utc="2025-03-12T15:22:14.753Z",
reason="order refunded"
)
print(cancellation.message)
print(f"Cancelled on: {cancellation.cancelled_on}")
You can obtain user_id and time_utc from the response of any impact action, or
from get_records() / get_customer_records().
📊 Data Access & Reporting
Get Records
Retrieve impact records with optional filtering.
from makeimpact import OneClickImpact
sdk = OneClickImpact("your_api_key")
# Get all records
records = sdk.get_records()
# Filter records by type
# (e.g. "tree_planted", "waste_removed", "carbon_captured", "coral_restored", "money_donated")
tree_records = sdk.get_records(filter_by="tree_planted")
coral_records = sdk.get_records(filter_by="coral_restored")
# Filter records by date range
recent_records = sdk.get_records(
start_date="2023-01-01",
end_date="2023-12-31"
)
# Pagination
paginated_records = sdk.get_records(
cursor="cursor_from_previous_response",
limit=10
)
Get Customer Records
Retrieve records for specific customers.
from makeimpact import OneClickImpact
sdk = OneClickImpact("your_api_key")
# Get records for a specific customer
customer_records = sdk.get_customer_records(
customer_email="customer@example.com"
)
# Filter customer records by type
customer_tree_records = sdk.get_customer_records(
customer_email="customer@example.com",
filter_by="tree_planted"
)
Get Customers
Retrieve customer information.
from makeimpact import OneClickImpact
sdk = OneClickImpact("your_api_key")
# Get all customers (default limit is 10)
customers = sdk.get_customers()
# Get customers with filtering and pagination
filtered_customers = sdk.get_customers(
customer_email="example@email.com", # Optional: Filter by email
limit=50, # Optional: Limit results (1-1000)
cursor="cursor_from_previous_response" # Optional: For pagination
)
🔍 Track Impact
Track the complete lifecycle and current status of a specific impact, including project location, assigned agents, completion status, and documentation.
from makeimpact import OneClickImpact
sdk = OneClickImpact("your_api_key")
# First create an impact
response = sdk.plant_tree(amount=1)
# Then track its progress
tracking_info = sdk.track(
user_id=response.user_id,
time_utc=response.time_utc
)
print(f"Tracking ID: {tracking_info.tracking_id}")
print(f"Impact Initiated: {tracking_info.impact_initiated}")
if tracking_info.project_location:
print(f"Project Location: {tracking_info.project_location}")
if tracking_info.assigned_agent:
print(f"Assigned Agent: {tracking_info.assigned_agent}")
if tracking_info.impact_completed:
print(f"Impact Completed: {tracking_info.impact_completed}")
You can also track impacts from historical records:
# Get records and track a specific impact
records = sdk.get_records(limit=1)
if records.user_records:
record = records.user_records[0]
tracking_info = sdk.track(
user_id=record.user_id,
time_utc=record.time_utc
)
print("Tracking Info:", tracking_info)
Track Response Fields:
tracking_id: Unique identifier for this impact (format:user_id-time_utc)impact_initiated: UTC timestamp when the impact was createdtree_planted,waste_removed,carbon_captured,coral_restored,money_donated: Impact metrics (optional)category: Impact category (e.g., "food" for food-bearing trees)donation_available: When the donation became available for the projectdonation_sent: When the donation was sent to the non-profitassigned_agent: Name of the agent or organization executing the impactproject_location: Detailed description of project location and partnerslocation_map: Google Maps embed URL for the project locationimpact_completed: When the impact was completeddonation_category: Type of impact funded (for donations)certificate: Certificate URL for the impact (only present in production)impact_video: URL to video recording or live sessionlive_session_date: Scheduled live session timestampproject_id: ID of the project assigned to this impact (when available)is_test_transaction: Whether this was a test transactionis_bonus_impact: Whether this was a bonus impact from subscription planscancelled_on: UTC timestamp when the impact was cancelled (present only for cancelled impacts)cancellation_reason: Reason provided when the impact was cancelled (optional)
Get Projects
Retrieve available environmental impact projects.
from makeimpact import OneClickImpact
sdk = OneClickImpact("your_api_key")
# Get all projects
projects = sdk.get_projects()
# Filter by impact type
tree_projects = sdk.get_projects(type="trees")
ocean_projects = sdk.get_projects(type="ocean")
carbon_projects = sdk.get_projects(type="carbon")
# Get projects in a specific language
german_projects = sdk.get_projects(locale="de")
for project in projects.projects:
print(f"{project.project_id}: {project.name} ({project.location})")
Get Project by ID
Retrieve full details for a specific project.
from makeimpact import OneClickImpact
sdk = OneClickImpact("your_api_key")
project = sdk.get_project_by_id("PROJECT_ID")
print(f"Name: {project.name}")
print(f"Type: {project.type}")
print(f"Location: {project.location}")
print(f"Organization: {project.organization}")
print(f"Available: {project.available}")
# SDG alignments
for sdg in project.sdgs:
print(f"SDG {sdg.number}: {sdg.title}")
# Get project in a specific language
project_es = sdk.get_project_by_id("PROJECT_ID", locale="es")
Project Fields:
project_id: Unique project identifiername: Project nametype: Impact type ("trees","ocean", or"carbon")location: Project location namedescription: Short project descriptionabout: Detailed project informationcountry_code: ISO country codeorganization: Executing organization namesdgs: List of UN Sustainable Development Goals this project aligns withimage_urls: List of project image URLslatitude,longitude: Project coordinatesavailable: Whether the project is currently active
Get Impact
Get aggregated lifetime impact statistics with breakdown between direct impact and customer impact.
from makeimpact import OneClickImpact
sdk = OneClickImpact("your_api_key")
# Get overall impact statistics for your organization
impact = sdk.get_impact()
# Total impact (user + customer)
print(f"Total trees planted: {impact.tree_planted}")
print(f"Total ocean waste removed: {impact.waste_removed} lbs")
print(f"Total carbon captured: {impact.carbon_captured} lbs")
print(f"Total money donated: ${impact.money_donated / 100}")
# Direct impact by your organization
print(f"\nDirect impact trees: {impact.user_impact.tree_planted}")
print(f"Direct impact waste removed: {impact.user_impact.waste_removed} lbs")
# Impact on behalf of customers
print(f"\nCustomer impact trees: {impact.customer_impact.tree_planted}")
print(f"Customer impact waste removed: {impact.customer_impact.waste_removed} lbs")
Get Daily Impact
Get time-series daily impact data with optional date range filtering.
from makeimpact import OneClickImpact
sdk = OneClickImpact("your_api_key")
# Get all daily impact data
daily_impact = sdk.get_daily_impact()
for day in daily_impact.daily_impact:
print(f"Date: {day.date}")
print(f" Trees: {day.tree_planted}")
print(f" Waste removed: {day.waste_removed} lbs")
print(f" Carbon captured: {day.carbon_captured} lbs")
print(f" Donated: ${day.money_donated / 100}")
# Get daily impact for specific date range
filtered_impact = sdk.get_daily_impact(
start_date="2025-01-01",
end_date="2025-12-31"
)
Who Am I
Verify your API key and get account information.
from makeimpact import OneClickImpact
sdk = OneClickImpact("your_api_key")
# Verify API key and get account information
account_info = sdk.who_am_i()
⚙️ Configuration
Environments
The SDK supports two environments:
- Production (default): Uses the live API at
https://api.1clickimpact.com - Sandbox: Uses the testing API at
https://sandbox.1clickimpact.com
To use the sandbox environment for testing:
from makeimpact import OneClickImpact, Environment
# Initialize with sandbox environment
sdk = OneClickImpact("your_test_api_key", Environment.SANDBOX)
🔗 Additional Resources
📄 License
MIT
Release files for makeimpact 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| makeimpact-2.0.0.tar.gz | 21.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| makeimpact-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 40.8 kB
Release files / makeimpact-2.0.0.tar.gz
| Download URL | makeimpact-2.0.0.tar.gz |
|---|---|
| Size | 21.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
62c11c2a8c75f7c9a43d85cd1658e6c3062e2047f3bef9f6f7cadb216ebf7ab6
|
|
BLAKE2b-256 checksum How to use checksums |
8a9032dc2e8892bfc0175c965d979aff75d25bab1a578cce20b76a8ac5d10729
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / makeimpact-2.0.0-py3-none-any.whl
| Download URL | makeimpact-2.0.0-py3-none-any.whl |
|---|---|
| Size | 19.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a8c69af8b667fa25a39177d037339ea37b4d22694b904179b3e85817c52c0edd
|
|
BLAKE2b-256 checksum How to use checksums |
ccce28037ce22f365dc75b04db0a289cd2f446427be94b06e0509335ab70eff4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|