A mock API service for testing solar credit data integration. This API provides fake but realistic-looking solar credit data for development and testing purposes.
- Live API: https://test-api-seven-mauve.vercel.app
- Test Endpoint: /api/test
- Clone the repository
- Install dependencies:
npm install
- Start the server:
Or for development with auto-reload:
npm start
npm run dev
GET https://test-api-seven-mauve.vercel.app/api/test
Simple health check endpoint that returns a hello message.
Response Example:
{
"message": "Hello test!"
}GET https://test-api-seven-mauve.vercel.app/api/solar-quote
Returns a mock solar credit quote with randomized pricing data.
Response Example:
{
"solar_credit_amount": "1",
"total_cost": "34.52",
"average_price": "28.16"
}GET https://test-api-seven-mauve.vercel.app/api/registry/retirements
Returns detailed mock data about solar credit retirements.
Query Parameters:
for_address(string): Wallet address to query retirements fordate_gte(string): Filter retirements after this date (YYYY-MM-DD format)
Response Example:
{
"total_count": 3,
"count_exceeded": false,
"total_amount_retired": 75.42,
"wallet_address": "0x123...",
"retirements": [
{
"issuance_date": "2024-03-15",
"instrument_type": "Solar Credit",
"vintage_start": "2023-01-01",
"vintage_end": "2024-01-01",
"total_vintage_quantity": 50000,
"vcs_id": "1234",
"vcs_name": "Solar Power Generation Project",
"vcs_category": "Renewable Energy",
"vcs_protocol": "SP001",
"additional_certifications": "LEED Gold",
"region": "North America",
"country": "USA",
"solar_credit_amount": 25.5,
"serial_numbers": "123e4567-e89b-12d3-a456-426614174000",
"retirement_date": "2024-02-01",
"retirement_beneficiary": "Solar Beneficiary abc-123",
"certificate_id": "123456",
"beneficiary_wallet": "0x123..."
}
// ... more retirement records
]
}- The API generates random but realistic-looking data using Faker.js
- Each request to
/api/registry/retirementswill generate 1-5 random retirement records - All dates are returned in ISO format (YYYY-MM-DD)
- The API supports CORS for cross-origin requests
- All monetary values are returned as strings with 2 decimal places
- Default port: 3000 (local development)
- Live API: https://test-api-seven-mauve.vercel.app
- No authentication required for testing
This is a test API - please be mindful with request frequency. While there are no strict rate limits, excessive requests may be throttled.
Feel free to open issues or submit pull requests for improvements to the mock data structure or additional endpoints.