API v1 (Legacy)
Drop-in replacement for the archived NASA Mars Rover API.
Recommendation: Use API v2
API v1 exists for compatibility with existing integrations. For new projects, use API v2 for more features:
- Multiple image sizes (small, medium, large, full)
- Mars time and location queries
- Camera angle filtering
- Rich metadata and telemetry
Overview
API v1 mirrors the original mars-photo-api (now archived). If you have existing code using that API, you can switch to Mars Vista with minimal changes.
The main difference: Mars Vista requires authentication via the X-API-Key header.
Endpoints
Get Photos by Sol
GET /api/v1/rovers/{rover}/photos?sol={sol}
curl -H "X-API-Key: YOUR_KEY" \
"https://api.marsvista.dev/api/v1/rovers/curiosity/photos?sol=1000"Get Photos by Earth Date
GET /api/v1/rovers/{rover}/photos?earth_date={date}
curl -H "X-API-Key: YOUR_KEY" \
"https://api.marsvista.dev/api/v1/rovers/curiosity/photos?earth_date=2015-05-30"Filter by Camera
curl -H "X-API-Key: YOUR_KEY" \
"https://api.marsvista.dev/api/v1/rovers/curiosity/photos?sol=1000&camera=fhaz"Pagination
curl -H "X-API-Key: YOUR_KEY" \
"https://api.marsvista.dev/api/v1/rovers/curiosity/photos?sol=1000&page=2"Response Format
{
"photos": [
{
"id": 102693,
"sol": 1000,
"camera": {
"id": 20,
"name": "FHAZ",
"rover_id": 5,
"full_name": "Front Hazard Avoidance Camera"
},
"img_src": "https://mars.nasa.gov/msl-raw-images/...",
"earth_date": "2015-05-30",
"rover": {
"id": 5,
"name": "Curiosity",
"landing_date": "2012-08-06",
"launch_date": "2011-11-26",
"status": "active"
}
}
]
}Rover Information
List All Rovers
curl -H "X-API-Key: YOUR_KEY" \
"https://api.marsvista.dev/api/v1/rovers"Get Rover Manifest
Get mission information including available sols:
curl -H "X-API-Key: YOUR_KEY" \
"https://api.marsvista.dev/api/v1/manifests/curiosity"Migration from Original API
If you're migrating from api.nasa.gov/mars-photos:
1. Update Base URL
// Old
https://api.nasa.gov/mars-photos/api/v1/rovers/curiosity/photos
// New
https://api.marsvista.dev/api/v1/rovers/curiosity/photos2. Switch from api_key param to X-API-Key header
// Old
curl "...?api_key=DEMO_KEY"
// New
curl -H "X-API-Key: YOUR_KEY" "..."3. Get Your API Key
Sign in to get a free API key. The original DEMO_KEY won't work.
Ready to Upgrade to v2?
API v2 offers powerful features not available in v1:
- Multiple image sizes for progressive loading
- Mars time and golden hour filtering
- Location-based queries and journey tracking
- Camera angle and panorama detection
- Full NASA metadata (100% vs v1's 5%)