Ssocialgraph.dev
API reference / Age & gender API / Age & gender image analysis

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.

1 credit per successful call Errors are never charged No login or OAuth needed

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

GET 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

NameTypeDescription
image_urls
required
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

StatusMeaningCharged?
401Missing, invalid or revoked API keyNo
402Not enough credits (insufficient_credits)No
404The account or post doesn't existNo
422Missing or invalid parametersNo
502 / 503The data source is temporarily unavailableNo

All error codes →

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.

Try it live: Age & gender image analysis GET

🔒 Preset demo input. The live demo analyses a portrait photo of David Beckham. Sign up free to use your own.

Start with 100 free credits

Create an account in seconds. No card, no subscription. Credits never expire.

Create free account →