Developer Reference

AfriTailor API

A simple, JSON-first API for UK size intelligence. Send body measurements or basic body stats and receive an exact UK clothing size (6–28) — ready to embed in your storefront, kiosk or fitting flow.

Overview

All endpoints return application/json. Requests and responses use UTF-8. The base URL for this deployment is:

https://afritailor.com.ng
PropertyValue
Base URLhttps://afritailor.com.ng
FormatJSON
MethodsGET, POST
EncodingUTF-8

Authentication

The Size Intelligence endpoint is public and requires no key — it performs a stateless calculation and stores nothing. The Lead Capture endpoint is protected by a per-session CSRF token issued by the website, so it can only be called from AfriTailor pages.

No body photos or measurements are persisted by the Size Intelligence endpoint. Inputs are used only to compute the response for that request.

Size Intelligence

Estimate a UK clothing size from body measurements (best accuracy) or from basic body stats such as height and weight.

GETPOST /api/measure.php

Parameters

NameTypeRequiredDescription
genderstringoptionalwomen · men · kids. Default women.
unitstringoptionalcm or in for length inputs. Default cm.
bustnumberone of*Bust / chest girth.
waistnumberone of*Natural waist girth.
hipnumberone of*Hip / seat girth.
heightnumberoptionalHeight. Used with weight when no girth is given.
weightnumberoptionalWeight in kg.

* Supply at least one of bust, waist, hip — or both height and weight.

Example request

# Girth-based (highest accuracy)
curl "https://afritailor.com.ng/api/measure.php?gender=women&waist=72&hip=98"

Example response

{
  "ok": true,
  "uk_size": 12,
  "label": "UK 12",
  "gender": "women",
  "confidence": "98%",
  "method": "measurements",
  "time_ms": 1,
  "inputs": { "waist_cm": 72, "hip_cm": 98 },
  "generated_at": "2026-07-29T12:00:00+00:00"
}

Test Playground

Fill in the fields and send a live request to the Size Intelligence endpoint. The exact request URL and raw JSON response are shown on the right.

Live request

Calls /api/measure.php in your browser.

Send a request to see the JSON response here.

Lead Capture

Stores a newsletter or “Get Started” email against the AfriTailor admin and notifies info@afritailor.com.ng. Requires the site-issued CSRF token, so it is intended for use by AfriTailor's own forms.

POST /api/subscribe.php

Parameters

NameTypeRequiredDescription
emailstringrequiredValid email address (max 190 chars).
sourcestringoptionalnewsletter or get-started. Default newsletter.
csrfstringrequiredSession CSRF token rendered into the page's forms.

Example response

{
  "ok": true,
  "message": "You're subscribed — thanks for joining AfriTailor."
}

Status Codes

CodeMeaning
200Success — response body contains the result.
403Invalid or expired CSRF token (Lead Capture).
405Method not allowed — use the documented verb.
422Validation error — a required/valid input is missing.

Support

Questions about integrating the API? We're happy to help.