Age and gender detection API: estimate age and gender from a face photo
Analyze a non-empty batch of publicly accessible image URLs and return age and gender estimates.
About the Age & gender image analysis endpoint
The age and gender detection API analyses the face in each image you send by URL and returns an estimated age, a gender and a face-detection confidence score, for up to 10 images per call. Images with no detectable face or that can't be downloaded are reported per image, so a batch never fails as a whole. There are no models to host or GPUs to run; one GET request does the work.
What you can build with it
- Audience and customer demographics from profile pictures
- Age-appropriate personalisation and content filtering
- Photo tagging and organisation by estimated age group
Request
https://socialgraph.dev/api/v1/age-gender/analyze/batch/download
Send your API key as Authorization: Bearer YOUR_API_KEY.
Parameters go in the query string.
Parameters
| Name | Type | Description |
|---|---|---|
image_urlsrequired |
array
max 10 items |
Up to 10 publicly accessible HTTPS image URLs. |
Code examples
Example response
[
{
"url": "https://example.com/photo-with-face.jpg",
"result": {
"age": 55,
"gender": "Man",
"face_confidence": 0.8426
}
},
{
"url": "https://example.com/photo-without-face.png",
"result": null
},
{
"url": "https://example.com/missing.jpg",
"error": "Failed to download https://example.com/missing.jpg: HTTP 404",
"status_code": 400
}
]Errors
| Status | Meaning | Charged? |
|---|---|---|
| 401 | Missing, invalid or revoked API key | No |
| 402 | Not enough credits (insufficient_credits) | No |
| 404 | The account or post doesn't exist | No |
| 422 | Missing or invalid parameters | No |
| 502 / 503 | The data source is temporarily unavailable | No |
Age & gender image analysis API: frequently asked questions
How do I detect age and gender from a photo?
Pass one or more public HTTPS image URLs as image_urls. For each image the response includes result.age, result.gender and result.face_confidence.
How many images can I analyse in one request?
Up to 10 image URLs per call.
What happens if an image has no face?
That image's result is null, or it carries an error if the image couldn't be downloaded. The other images in the batch are still analysed.
Are the images stored?
socialgraph.dev doesn't keep the images. They are downloaded by the analysis service to compute the estimate, and only the results are returned to you.
How much does the Age & gender image analysis endpoint cost?
1 credit per successful call (0.002 USD at 500 credits per dollar). Errors, "not found" responses and invalid input are never charged, and credits never expire.
Can I try the Age & gender image analysis API without signing up?
Yes. The live demo on this page runs a real request with a fixed sample input, free and without an account. Creating a free account gives you 100 credits to test every endpoint with your own inputs.
🔒 Preset demo input. The live demo analyses a portrait photo of David Beckham. Sign up free to use your own.