🚧 Our API is currently in limited beta access while we complete prototype testing. Request early access or view our development roadmap. 🚧

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.

bash
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.

javascript
// 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:

JavaScript

Perfect for web applications and Node.js backends.

Get SDK

Python

Ideal for data analysis and backend services.

Get SDK

Java

For enterprise applications and Android development.

Get SDK

Swift

Build iOS applications with TreasureBot integration.

Get SDK

Core Endpoints

Explore the main endpoints available in the TreasureBot API:

Recycling Data

Access information about recycling activities, waste categories, and material types.

GET /v1/recycling/materials

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.

POST /v1/users

Create a new user account in the TreasureBot system.

json
{
    "email": "user@example.com",
    "first_name": "John",
    "last_name": "Doe",
    "password": "secure_password",
    "region": "eu-west",
    "opt_in_newsletter": true
}
GET /v1/users/{user_id}/statistics

Retrieve recycling statistics for a specific user.

Green Points

Integrate with TreasureBot's reward system to manage and track user sustainability points.

POST /v1/points/award

Award Green Points to a user for environmentally-friendly actions.

json
{
    "user_id": "usr_12345",
    "points": 25,
    "action_type": "recycle",
    "material_type": "plastic_bottle",
    "location_id": "loc_berlin_001"
}
GET /v1/points/leaderboard

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.

POST /v1/ai/identify

Identify recyclable materials from image data.

GET /v1/ai/recommendations/{material_id}

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:

javascript
// 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
Sign Up for API Access

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:

January 2025

Limited Beta Launch

Core API endpoints released to selected partners for initial testing and feedback.

  • Basic authentication
  • Material database access
  • User management endpoints
April 2025 - Current Phase

Extended Beta Testing

Expanded feature set and increased stability based on initial feedback.

  • Green Points integration
  • JavaScript SDK release
  • Improved documentation
June 2025

AI Capabilities Release

Integration of TreasureBot's machine learning models for material identification.

  • Image analysis API
  • Material identification endpoints
  • Recycling recommendations
September 2025

Public Beta Launch

Open access to all developers with freemium pricing model.

  • All SDKs released
  • Developer portal improvements
  • Enhanced analytics
December 2025

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 Forum

Documentation

Comprehensive guides, reference materials, and code examples to help you implement our API.

View Docs

Technical Support

Get expert help with your integration from our dedicated support team.

Contact Support

Success 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