Overview
The Resource Service supports three types of data sources for collecting sustainability indicators. Each source type has its own configuration schema and wrapper behavior:API
Real-time data from REST APIs with authentication support
CSV
Comma-separated value files with structured tabular data
XLSX
Excel spreadsheets with support for multiple sheets
Source Type Enumeration
Source types are defined as an enumeration:API Sources
API sources enable continuous, real-time data collection from REST endpoints.Configuration Schema
Authentication Methods
The service supports four authentication types:- API Key
- Bearer Token
- Basic Auth
- None
Pass an API key in a custom header:Generated Auth Code:
Custom Headers and Parameters
You can specify additional headers and query parameters:AI-Assisted API Exploration
For API sources, the AI can use tools to explore the endpoint during wrapper generation:The AI makes actual API calls during generation to understand response structure, field naming, and data formats. This results in more accurate, robust wrappers.
API Sample Extraction
Before generation, the system fetches a sample response:API Wrapper Behavior
Execution Mode: Continuous (runs indefinitely) Phase Progression:- Historical Phase: Collects all past data
- Continuous Phase: Polls for new data based on periodicity
- Created → Generating → Executing → (runs until stopped)
- Automatically resumes after service restart using checkpoints
CSV Sources
CSV sources are ideal for one-time bulk imports or periodic file uploads.Configuration Schema
The
location field is automatically populated by the backend when a file is uploaded. You only need to provide the file_id received from the file upload endpoint.File Upload Flow
CSV Sample Extraction
The generator extracts the first 20 lines for AI analysis:CSV Wrapper Behavior
Execution Mode: Once (processes file and completes) Lifecycle:- Created → Generating → Executing → Completed
- Status changes to
COMPLETEDafter all rows are processed
XLSX Sources
XLSX sources support Excel spreadsheets with multiple sheets and complex structures.Configuration Schema
File Upload Flow
Identical to CSV, but with.xlsx files:
XLSX Sample Extraction
Extracts metadata and samples from all sheets:XLSX Wrapper Behavior
Execution Mode: Once (processes all sheets and completes) Multi-Sheet Handling:- AI determines which sheet(s) contain the actual data
- Can extract from multiple sheets if needed
- Handles varying column structures across sheets
The AI is particularly good at identifying the correct sheet when files contain metadata sheets, summary sheets, and data sheets together.
Source Configuration Comparison
- Feature Comparison
- Use Cases
- Performance
| Feature | API | CSV | XLSX |
|---|---|---|---|
| Execution | Continuous | Once | Once |
| Authentication | Yes | No | No |
| File Upload | No | Yes | Yes |
| Historical Data | Yes | Full file | Full file |
| Real-time Updates | Yes | No | No |
| Multiple Sources | Single endpoint | Single file | Multiple sheets |
| Checkpointing | Yes | No | No |
| Auto-resume | Yes | No | No |
Data Source Selection Guide
Choose the appropriate source type based on your needs:Assess data update frequency
- Real-time or frequent updates → API
- Periodic updates → API with appropriate periodicity
- One-time or rare updates → CSV or XLSX
Evaluate data structure
- Simple tabular data → CSV
- Multiple related datasets → XLSX
- Dynamic/nested structures → API
Consider data source constraints
- Authentication required → API (supports auth)
- No API available → File upload (CSV/XLSX)
- Rate limits → Adjust API periodicity
Best Practices
API Sources
API Sources
✅ Do:
- Test the API endpoint before creating a wrapper
- Use the most specific
date_fieldandvalue_fieldpossible - Set appropriate timeout values for slow APIs
- Use query parameters to filter data at the source
- Hard-code credentials in the configuration
- Use extremely short periodicities that could hit rate limits
- Ignore authentication errors (check logs immediately)
CSV Sources
CSV Sources
✅ Do:
- Use UTF-8 encoding
- Include clear column headers in the first row
- Use consistent date formats (ISO 8601 recommended)
- Keep files under 50MB for best performance
- Use non-standard delimiters (stick to commas)
- Include summary rows or merged cells
- Use multiple date/time formats in the same file
XLSX Sources
XLSX Sources
✅ Do:
- Use descriptive sheet names
- Place data in the first row/column without gaps
- Use consistent formatting within each sheet
- Name sheets according to their content (e.g., “2024_Data”)
- Use heavily formatted spreadsheets with merged cells
- Include charts or pivot tables in data sheets
- Use formulas in data cells (export values only)
- Mix data types in the same column
Troubleshooting
API Connection Errors
API Connection Errors
Symptoms: Wrapper status is ERROR, logs show connection timeoutsSolutions:
- Verify the endpoint URL is correct and accessible
- Check authentication credentials are valid
- Increase
timeout_secondsfor slow APIs - Ensure network connectivity from the service
CSV Parsing Errors
CSV Parsing Errors
Symptoms: Wrapper completes but no data points sentSolutions:
- Verify file encoding is UTF-8
- Check for consistent column structure
- Ensure date columns use recognizable formats
- Look for special characters or malformed rows
XLSX Sheet Detection Issues
XLSX Sheet Detection Issues
Symptoms: AI selects wrong sheet or misses dataSolutions:
- Use descriptive sheet names (avoid generic names like “Sheet1”)
- Move metadata/summary sheets to the end
- Ensure data sheets have clear headers in row 1
- Manually specify the sheet in indicator description
Next Steps
Create a Wrapper
Step-by-step guide to creating wrappers for each source type
Wrappers
Learn more about how wrappers work and execute
File Upload API
API reference for uploading CSV and XLSX files
Wrapper API
Complete API reference for wrapper management