Developer API
Integrate TreasureBot's powerful recycling data and services into your applications
Getting Started
Welcome to the TreasureBot API. Our RESTful API allows developers to integrate recycling data, user engagement tools, and sustainability metrics into their applications. Follow the steps below to get started:
1. Register for API Access
Create a developer account in our Developer Portal and generate your API key. This key is required for all API calls to authenticate your application.
curl -X POST "https://api.treasurebot.io/v1/auth/token" \
-H "Content-Type: application/json" \
-d '{"client_id": "YOUR_CLIENT_ID", "client_secret": "YOUR_CLIENT_SECRET"}'
2. Authentication
All API requests require an access token. Request a token using your client credentials and include it in the Authorization header of your API requests.
// Example using fetch API
async function getToken() {
const response = await fetch('https://api.treasurebot.io/v1/auth/token', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
client_id: 'YOUR_CLIENT_ID',
client_secret: 'YOUR_CLIENT_SECRET'
})
});
const data = await response.json();
return data.access_token;
}
Available SDKs
Use our official software development kits to integrate with TreasureBot more easily:
Core Endpoints
Explore the main endpoints available in the TreasureBot API:
Recycling Data
Access information about recycling activities, waste categories, and material types.
Returns a list of recyclable materials with their properties and handling instructions.
Parameter | Type | Description |
---|---|---|
category | string | Filter materials by category (plastic, paper, glass, etc.) |
region | string | Filter by geographic region to get region-specific recycling information |
limit | integer | Maximum number of results to return (default: 20) |
User Management
Manage TreasureBot user accounts and access user-specific recycling data.
Create a new user account in the TreasureBot system.
{
"email": "user@example.com",
"first_name": "John",
"last_name": "Doe",
"password": "secure_password",
"region": "eu-west",
"opt_in_newsletter": true
}
Retrieve recycling statistics for a specific user.
Green Points
Integrate with TreasureBot's reward system to manage and track user sustainability points.
Award Green Points to a user for environmentally-friendly actions.
{
"user_id": "usr_12345",
"points": 25,
"action_type": "recycle",
"material_type": "plastic_bottle",
"location_id": "loc_berlin_001"
}
Get the Green Points leaderboard for a specific region or organization.
Machine Learning Tools
Access TreasureBot's AI capabilities for material recognition and recycling guidance.
Identify recyclable materials from image data.
Get AI-powered recycling recommendations for a specific material.
Example Implementation
Here's a simple example of integrating TreasureBot's Green Points system into your application:
// Initialize TreasureBot client
const treasureBot = new TreasureBot({
apiKey: 'YOUR_API_KEY',
region: 'eu-west'
});
// Award points to user when they recycle
async function awardRecyclingPoints(userId, materialType, quantity) {
try {
const pointsAwarded = await treasureBot.points.award({
userId,
action: 'recycle',
materialType,
quantity,
timestamp: new Date().toISOString()
});
console.log(`User awarded ${pointsAwarded} Green Points!`);
// Update user interface with new points total
updateUserPointsDisplay(userId);
return pointsAwarded;
} catch (error) {
console.error('Failed to award points:', error);
return 0;
}
}
// Get user's sustainability impact statistics
async function getUserImpactStats(userId) {
const stats = await treasureBot.users.getStatistics(userId);
// Display impact metrics to the user
updateImpactDashboard({
totalPoints: stats.total_green_points,
co2Saved: stats.co2_savings_kg,
materialsRecycled: stats.total_materials_recycled,
treesEquivalent: stats.trees_saved_equivalent
});
}
Rate Limits & Pricing
Our API is available in multiple tiers to accommodate different usage needs:
Plan | Rate Limit | Price | Features |
---|---|---|---|
Developer | 1,000 requests/day | Free | Basic endpoints, development environment only |
Startup | 50,000 requests/day | €99/month | All endpoints, production access, basic support |
Business | 500,000 requests/day | €499/month | All endpoints, higher rate limits, priority support |
Enterprise | Custom | Contact Sales | Custom integration, SLA, dedicated support |
Request Early Access
Our API is currently in limited beta testing. Submit your details below to join our early access program and be among the first to integrate TreasureBot's recycling technology into your applications.
Our team reviews applications weekly. If selected, you'll receive developer credentials and documentation within 5 business days.
API Development Roadmap
Here's our planned timeline for API feature releases and improvements:
Limited Beta Launch
Core API endpoints released to selected partners for initial testing and feedback.
- Basic authentication
- Material database access
- User management endpoints
Extended Beta Testing
Expanded feature set and increased stability based on initial feedback.
- Green Points integration
- JavaScript SDK release
- Improved documentation
AI Capabilities Release
Integration of TreasureBot's machine learning models for material identification.
- Image analysis API
- Material identification endpoints
- Recycling recommendations
Public Beta Launch
Open access to all developers with freemium pricing model.
- All SDKs released
- Developer portal improvements
- Enhanced analytics
General Availability
Full production release with SLA guarantees.
- Enterprise features
- Advanced integration options
- Partner program launch
Want to influence our roadmap? Join our Developer Community to provide feedback and suggestions.
Developer Community & Support
Join our growing community of sustainability-focused developers and get the help you need:
Developer Forum
Connect with other developers, share your implementations, and get answers to your questions.
Join ForumDocumentation
Comprehensive guides, reference materials, and code examples to help you implement our API.
View DocsTechnical Support
Get expert help with your integration from our dedicated support team.
Contact SupportSuccess Stories
See how innovative companies are using TreasureBot's API to drive sustainability:
EcoTrack App
"TreasureBot's API allowed us to add material scanning to our app in just two weeks, increasing user engagement by 78%."
— Maria Schöfer, CTO of EcoTrack
GreenCity Initiative
"We've integrated TreasureBot's Green Points system into our city rewards program, resulting in a 35% increase in proper recycling rates."
— Lukas Meyer, Project Manager
Circular Economy Institute
"The sustainability metrics available through TreasureBot's API have been invaluable for our research into urban recycling patterns."
— Dr. Sarah Lindemann, Research Director