Where Is This Photo API
Integrate Where Is This Photo photo location detection directly into your applications with this easy to use API.
About the API
The 3 endpoints below are all you need to integrate photo location detection into your workflow.
/v1/locationLocate Photo
Submit a URL of the target image and receive a prediction of the location of that image, along with other details such as the location title, coordinates and the Where Is This Photo ID for future reference.
/v1/location?id={id}Get Prediction
Retrieve a previously made prediction using the prediction ID. Useful for fetching prediction details later.
/v1/account-detailsAccount Details
Check your account status to view your remaining prediction credits.
API Pricing
Simple monthly plans that scale with your usage. All plans include the same great features.
How Credit Rollover Works
Unused credits automatically roll over to the next month, so you never lose the value of your subscription. Credits continue to accumulate month after month as long as your account is actvie. Even after cancelling your subscription, you will still have access to your remaining credits.
Example with Professional Plan (350 credits/month):
- Month 1: You receive 350 credits and use 300 → 50 credits roll over
- Month 2: You receive 350 and use 300 → 50 rollover = 100 credits available at the end of the month
- Month 3+: Unused credits continue to accumulate each month
Need more credits?
Contact us for custom enterprise plans or purhase more one time credits in your account page.
Documentation
Everything you need to integrate the Where Is This Photo API into your application.
Base URL
https://api.whereisthisphoto.comPostman Collection
Get started quickly with our Postman collection. View on GitHub
Authentication
1Generate Your API Credentials
To get started, generate an API key in your account page. When you create a new API key, you will receive two pieces of information:
A unique identifier for your API key. This can be viewed anytime in your account.
A secure secret used to authenticate your requests. Keep this safe!
Important: Store Your Secret Securely
Due to the nature of secure hashing, your API secret will only be shown once — at the moment of creation. Store it securely immediately. The secret cannot be retrieved later by anyone, including Where Is This Photo administrators. If you lose your secret, you will need to generate a new API key.
2Authenticate Your Requests
Include your credentials in the Authorization header of every API request using the following format:
Authorization: ApiKey {api_key_id}:{api_secret}3Example Request
Here's an example of how to include the authorization header in your request:
curl -X POST https://api.whereisthisphoto.com/v1/location \
-H "Authorization: ApiKey ak_abc123def456:sk_xyz789secret" \
-H "Content-Type: application/json" \
-d '{"imageUrl": "https://example.com/photo.jpg"}'Tip: When you generate an API key, the UI will provide the complete authorization header value ready for you to copy and use.
Endpoints
Available API endpoints for photo location detection.
/v1/locationLocate Photo
Submit a publicly accessible URL to the target image and receieve a prediction of the location of the image including a title, description and coordinates.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| imageUrl | string | Required | A publicly accessible URL to the image you want to locate. Supports all image formats. |
Example Request
{
"imageUrl": "https://example.com/photo.jpg"
}Response Fields
| Field | Type | Description |
|---|---|---|
| coordinates | object | Contains latitude and longitude of the predicted location |
| coordinates.latitude | number | Latitude coordinate of the predicted location |
| coordinates.longitude | number | Longitude coordinate of the predicted location |
| description | string | Detailed AI-generated description explaining how the location was identified, including distinctive visual features |
| imageURL | string | The URL of the processed image (echoed from request) |
| locationTitle | string | Human-readable location name including landmarks, city, and country |
| moderationPassed | boolean | Indicates whether the image passed content moderation checks |
| predictionId | number | Unique identifier for this prediction, useful for tracking and support |
Example Response
{
"coordinates": {
"latitude": 39.6543,
"longitude": 66.975
},
"description": "Night view of Sher-Dor Madrasa on Registan Square in Samarkand, Uzbekistan. Distinctive features include the massive pishtaq (arched portal) flanked by two tall minarets, intricate turquoise-and-blue geometric tilework, and the ribbed turquoise dome set just behind the facade—hallmarks of the Sher-Dor Madrasa on the eastern side of Registan.",
"imageURL": "https://example.com/photo.jpg",
"locationTitle": "Sher-Dor Madrasa, Registan Square, Samarkand, Uzbekistan",
"moderationPassed": true,
"predictionId": 96864
}/v1/locationGet Prediction
Retrieve a previously made prediction by its ID. This is useful for fetching prediction details at a later time or sharing prediction results.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | number | Required | The predictionId returned from a previous POST request to /v1/location. |
Example Request
GET https://api.whereisthisphoto.com/v1/location?id=96864Response Fields
| Field | Type | Description |
|---|---|---|
| coordinates | object | Contains latitude and longitude of the predicted location |
| coordinates.latitude | number | Latitude coordinate of the predicted location |
| coordinates.longitude | number | Longitude coordinate of the predicted location |
| description | string | Detailed AI-generated description explaining how the location was identified, including distinctive visual features |
| imageURL | string | A signed URL to access the processed image (expires after 1 hour) |
| locationTitle | string | Human-readable location name including landmarks, city, and country |
| moderationPassed | boolean | Indicates whether the image passed content moderation checks |
| predictionId | string | Unique identifier for this prediction |
Example Response
{
"coordinates": {
"latitude": 39.6543,
"longitude": 66.975
},
"description": "Night view of Sher-Dor Madrasa on Registan Square in Samarkand, Uzbekistan. Distinctive features include the massive pishtaq (arched portal) flanked by two tall minarets, intricate turquoise-and-blue geometric tilework, and the ribbed turquoise dome set just behind the facade—hallmarks of the Sher-Dor Madrasa on the eastern side of Registan.",
"imageURL": "https://example.com/photo.jpg",
"locationTitle": "Sher-Dor Madrasa, Registan Square, Samarkand, Uzbekistan",
"moderationPassed": true,
"predictionId": "96864"
}/v1/account-detailsAccount Details
Check your account status and available prediction credits. Use this endpoint to monitor your usage and ensure you have sufficient credits before making location predictions.
Parameters
This endpoint does not require any parameters.
Example Request
GET https://api.whereisthisphoto.com/v1/account-detailsResponse Fields
| Field | Type | Description |
|---|---|---|
| predictionCreditsAvailable | number | The number of API credits remaining in your account |
Example Response
{
"predictionCreditsAvailable": 93
}Frequently Asked Questions
Common questions about the WhereIsThisPhoto API
How can I generate an API key?
You can generate an API key in your account page. Go to the API Configuration tab and click the "Create API Key" button. The secret key is only available once and cannot be retrieved again. Make sure to store this somewhere safe.
How can I retrieve my secret key after the API key is created?
You can't. API secret keys are only available once and cannot be retrieved again. This is for security reasons.
How do API credits work?
Each photo location prediction uses 1 credit. Unused credits roll over to the next month. You can view your credits using the account-details GET endpoint or by checking your account page.
What image formats are supported?
All image formats are supported. Images must be submitted via a publicly accessible URL.
Is there a rate limit?
There is no limit to the number of API calls you can make. However, there is throttling limits on the API to ensure service stability.
What does moderationPassed mean?
The moderationPassed field indicates whether the submitted image passed our content moderation checks. If false, the image was rejected and location data will not be returned.
Can I cancel my subscription?
Yes, you can cancel anytime from your account page. Your remaining credits will continue to work after you cancel.
Is there a way to get more credits?
Yes, you can purchase more credits from your account page. Go to the Prediction Credits tab and select the package you want to purchase. These credits will then be added to your account balance and can be used in the API.
Can I use my API credits in the UI?
Yes! API credits can be used to make predictions in the UI on the home page.
Ready to Get Started?
Create your API key in seconds and start integrating photo location detection into your application today.
Get Your API Key