Quick Start
Make your first API request in under 5 minutes.
1Get Your API Key
All API requests require an API key. Sign in to get yours for free:
Already have a key? Skip to step 2.
2Make Your First Request
Query the latest photos from Curiosity rover:
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.marsvista.dev/api/v2/photos?rovers=curiosity&per_page=5&include=rover,camera"3Explore the Response
You'll receive a JSON response with photo data:
{
"data": [
{
"id": 2544294,
"type": "photo",
"attributes": {
"nasa_id": "1533956",
"sol": 4728,
"earth_date": "2025-11-24",
"images": {
"small": "https://mars.nasa.gov/..._320.jpg",
"medium": "https://mars.nasa.gov/..._800.jpg",
"large": "https://mars.nasa.gov/..._1200.jpg",
"full": "https://mars.nasa.gov/..._full.jpg"
}
},
"relationships": {
"rover": {
"id": "curiosity",
"attributes": { "name": "Curiosity", "status": "active" }
},
"camera": {
"id": "NAVCAM",
"attributes": { "full_name": "Navigation Camera" }
}
}
}
],
"meta": { "total_count": 682660, "returned_count": 5 },
"pagination": { "page": 1, "per_page": 5, "total_pages": 136532 }
}Key Concepts
The include Parameter
Always use include=rover,camera to get rover and camera details in the response. Without it, the relationships object will be empty.
Image Sizes (Vary by Rover)
Perseverance: All 4 sizes (small,medium,large,full). Other rovers: Only full. Always use full as fallback.
Sol vs Earth Date
A "sol" is a Martian day (~24h 39m). Each rover counts sols from landing. Sol 1000 for Curiosity is a different Earth date than Sol 1000 for Perseverance.
Pagination
Results are paginated. Use page andper_page (max 100) to navigate. The links object provides URLs for next/prev pages.
Common Queries
Photos from a specific sol
curl -H "X-API-Key: YOUR_KEY" \
"https://api.marsvista.dev/api/v2/photos?rovers=curiosity&sol_min=1000&sol_max=1000&include=rover,camera"Photos from a specific Earth date
curl -H "X-API-Key: YOUR_KEY" \
"https://api.marsvista.dev/api/v2/photos?date_min=2024-01-15&date_max=2024-01-15&include=rover,camera"Photos from multiple rovers
curl -H "X-API-Key: YOUR_KEY" \
"https://api.marsvista.dev/api/v2/photos?rovers=curiosity,perseverance&per_page=10&include=rover,camera"Next Steps
- Authentication →Learn about rate limits and managing your API key
- Photos Reference →Complete guide to querying photos
- Understanding Mars Time →Deep dive into sols and Mars local time
Mars Vista is free and open source. If you'd like to support its hosting and development, you can sponsor on GitHub →