Overview
This guide helps you migrate from the legacy AVERT Imagery API (v1) to the new unified API v2. The migration involves updating endpoints, parameter names, and response handling.Why Migrate?
Unified API
Single endpoint replaces multiple endpoints
Better Filtering
New atmospheric and temporal filters
Smart Downloads
Get estimates before downloading
Improved Pagination
Comprehensive pagination metadata
Breaking Changes Summary
Migration Steps
Step 1: Update Endpoint URLs
v1: Separate endpointsStep 2: Update Parameter Names
Date range parameters have new names and format:Step 3: Update Response Handling
v1: Returns array directlyStep 4: Update Download Logic
v1: Fixed 100-image limitNew Features in v2
1. Condition Filters
v2 adds new filters for image quality and visibility conditions:2. Temporal Sampling (freq)
Dramatically reduce dataset size while maintaining temporal coverage:all- All captured images (default)minutely- One per minutehourly- One per hourdaily- One per day
3. Enhanced Pagination
v2 provides comprehensive pagination metadata:4. Query Echo
v2 includes your query parameters in the response for debugging:Complete Migration Example
Here’s a complete before/after example:Migration Checklist
Use this checklist to ensure complete migration:1
Update endpoint URLs
- Replace
/api/imagery/infrared/querywith/api/imagery/q?imageType=infrared - Replace
/api/imagery/visible/querywith/api/imagery/q?imageType=visible - Update base URL to
https://avert.ldeo.columbia.edu
2
Update parameters
- Replace
search_fromwithdatefrom - Replace
search_towithdateto - Convert date format from ISO 8601 to
yyyymmddhhmmss - Add
imageTypeparameter
3
Update response handling
- Extract
data['results']instead of using response directly - Access pagination via
data['pagination'] - Update loops to iterate over
data['results']
4
Update download logic
- Add
download=estimatecall before downloading - Show estimate to users
- Change
download=Truetodownload='true'(string)
5
Add new features (optional)
- Add condition filters (
is_empty,is_night,is_degraded,low_visibility) - Add temporal sampling (
freqparameter) - Implement pagination navigation
- Add rate limit handling with retry logic
6
Test thoroughly
- Test basic queries
- Test with filters
- Test pagination
- Test downloads with estimates
- Test error handling
Common Migration Issues
TypeError: 'list' object has no attribute 'results'
TypeError: 'list' object has no attribute 'results'
Issue: Trying to access
.results on v1 responseSolution: Update response handling400 Error: Invalid date format
400 Error: Invalid date format
Issue: Using ISO 8601 date format with v2 APISolution: Convert to
yyyymmddhhmmss formatImages not filtered by type
Images not filtered by type
Issue: Forgot to add
imageType parameterSolution: Explicitly specify image typeDownload returns JSON instead of ZIP
Download returns JSON instead of ZIP
Issue: Using wrong value for download parameterSolution: Use string ‘true’ not boolean True
Testing Your Migration
Test your migrated code with these queries:Test 1: Basic Query
Test 2: Date Filtering
Test 3: Download Estimate
Getting Help
API v2 Documentation
Complete v2 API reference
Query Endpoint Reference
Detailed endpoint documentation
Contact Support
Get help from the AVERT team
v1 Documentation
Legacy API reference (if needed)

