Skip to content
96Astro API

BaZi Compatibility

POSTAvailable

POSThttps://api.96astroapi.com/v1/chinese/bazi-match

Four Pillars matching of two people: day-master elements and stem combinations, the spouse palace (day branches), year branches, each chart's useful element, the spouse star, and the year Na Yin, each factor with its rule and points, and a score from 50.

Credits
1 credit
Input
Specific input
Output
JSON
Delivery
Direct response
Languages
English; translated term names with labels
Headers
HeaderValue and description
AuthorizationRequiredBearer YOUR_API_KEY

Your sandbox (sk_test_...) or live (sk_live_...) key. X-API-Key: <key> is accepted instead.

Content-TypeRequiredapplication/json

The body is JSON.

Idempotency-KeyOptional<unique string>

Makes retries safe: a repeated key with the same body replays the stored response and is never charged twice. (1 to 200 characters)

Body · application/json
FieldDescription
person_aobjectRequired
person_a.birthobjectRequired

A birth for a calculation that is not sidereal (Western, Human Design, Chinese): no ayanamsha.

person_a.birth.datetimestringRequired

Local date and time, ISO 8601 without offset, e.g. 1990-10-18T14:30:00

Limits: format local-date-time, pattern ^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(:\d{2}(\.\d{1,6})?)?$

Example: 1990-10-18T14:30:00

person_a.birth.timezonestring | nullOptional

IANA time zone, e.g. Asia/Kolkata

Default: null

Example: Asia/Kolkata

person_a.birth.utc_offsetstring | nullOptional

Fixed offset such as +05:30, if no IANA zone is known

Default: null

Limits: pattern ^[+-]?\d{1,2}(:[0-5]\d)?$

Example: +05:30

person_a.birth.latitudenumber | nullOptional

Latitude in decimal degrees, north positive, e.g. 28.6139. Required unless `place` is given.

Default: null

Limits: minimum -90, maximum 90

Example: 28.6139

person_a.birth.longitudenumber | nullOptional

Longitude in decimal degrees, east positive, e.g. 77.209. Required unless `place` is given.

Default: null

Limits: minimum -180, maximum 180

Example: 77.209

person_a.birth.placestring | nullOptional

Place of birth by name, e.g. 'Pune, India', instead of latitude and longitude: resolved from the same catalogue as `geo-search` (best match), which also supplies the time zone when none is sent. Coordinates, when sent, win.

Default: null

Limits: at most 120 characters

person_a.birth.languagestringOptional

Output language (ISO 639-1). Each capability lists the languages it supports.

Default: en

person_a.genderstringRequired

Sets the spouse star (Wealth for a man, Officer for a woman).

Allowed values: malefemale

Example: male

person_bobjectRequired
person_b.birthobjectRequired

A birth for a calculation that is not sidereal (Western, Human Design, Chinese): no ayanamsha.

person_b.birth.datetimestringRequired

Local date and time, ISO 8601 without offset, e.g. 1990-10-18T14:30:00

Limits: format local-date-time, pattern ^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(:\d{2}(\.\d{1,6})?)?$

Example: 1992-03-04T06:15:00

person_b.birth.timezonestring | nullOptional

IANA time zone, e.g. Asia/Kolkata

Default: null

Example: Asia/Kolkata

person_b.birth.utc_offsetstring | nullOptional

Fixed offset such as +05:30, if no IANA zone is known

Default: null

Limits: pattern ^[+-]?\d{1,2}(:[0-5]\d)?$

Example: +05:30

person_b.birth.latitudenumber | nullOptional

Latitude in decimal degrees, north positive, e.g. 28.6139. Required unless `place` is given.

Default: null

Limits: minimum -90, maximum 90

Example: 19.076

person_b.birth.longitudenumber | nullOptional

Longitude in decimal degrees, east positive, e.g. 77.209. Required unless `place` is given.

Default: null

Limits: minimum -180, maximum 180

Example: 72.8777

person_b.birth.placestring | nullOptional

Place of birth by name, e.g. 'Pune, India', instead of latitude and longitude: resolved from the same catalogue as `geo-search` (best match), which also supplies the time zone when none is sent. Coordinates, when sent, win.

Default: null

Limits: at most 120 characters

person_b.birth.languagestringOptional

Output language (ISO 639-1). Each capability lists the languages it supports.

Default: en

person_b.genderstringRequired

Sets the spouse star (Wealth for a man, Officer for a woman).

Allowed values: malefemale

Example: female

labelsstringOptional

Optional. Adds `meta.labels`: translated display names for the identifiers in the answer. `data` is unchanged. Free. Any other code is refused with 422 unsupported_language.

Allowed values: asbndeesfrguhiitjaknkomlmrnenlorpaplptrusitatetrur

Response · fields in data

Inferred from the example response: a guide to the shape, not a contract.

  • person_a · object
  • person_b · object
  • factors · array of object
  • spouse_star · object
  • score · object
  • source · string
  • disclaimer · string

Try in Playground →Capability overview

Example request

Example response

200application/json
{
  "data": {
    "person_a": {
      "pillars": {
        "year": "Geng Wu",
        "month": "Bing Xu",
        "day": "Bing Chen",
        "hour": "Yi Wei"
      },
      "day_master": {
        "stem": "Bing",
        "element": "Fire",
        "polarity": "Yang"
      },
      "strength": "balanced",
      "useful_elements": [],
      "dominant_element": "Earth",
      "nayin": {
        "year": "Roadside Earth",
        "month": "Roof Tile Earth",
  …

Captured from the live engine with a sandbox key (so credits_used is 0) and trimmed: long arrays keep their first items.

Error responses

  • 400invalid_request
  • 401invalid_key, expired_key
  • 402payment_required
  • 403account_suspended, plan_upgrade_required, plan_family_not_included, key_scope_denied, ip_not_allowed, origin_not_allowed, publishable_key_not_allowed
  • 404not_found
  • 409idempotency_conflict
  • 413payload_too_large
  • 422invalid_request, unsupported_language
  • 429rate_limited, quota_exhausted, spend_cap_reached, project_budget_exceeded
  • 500computation_failed
  • 502unavailable
  • 503unavailable, maintenance, temporarily_unavailable
  • 504deadline_exceeded

Errors are never charged. What each status means and what to do: errors.

Was this page helpful?

Send us feedback

What is it about?