vedicAPI

Chart image

SVG or PNG of a chart in North, South or East Indian style. Labels follow lang.

POST/chart/image/{chart}
Counts as 1 API call

Authentication

Send your API key as a Bearer token. Keys start with sk_live_. Keep keys on your server. More on keys

Authorization: Bearer $VEDICAPI_KEY

Headers

  • Authorization
    Requiredrequired
    DescriptionBearer followed by your API key.
  • X-End-User
    Requiredoptional
    DescriptionYour own id for the person the call is for, up to 64 characters. Shows in Request logs. End-user tags
  • Content-Type
    Requiredrequired
    Descriptionapplication/json

Path parameters

  • chartstringrequired

    Any divisional chart (D1 to D60), or moon, sun or chalit.

    Example D1One of D1, D2, D3, D3-s, D7, D9, D10, D10-R, D11, D12, D16, D20, D24, D24-R, D30, D40, D45, D60, moon, sun, chalit

Body parameters

  • datetimestringrequired

    Local birth time, ISO 8601 with no offset: 1990-10-21T00:45. Seconds are optional.

    Example 1990-10-21T00:45
  • latnumberrequired

    Latitude of the birth place, -90 to 90.

    Example 28.6139
  • lonnumberrequired

    Longitude of the birth place, -180 to 180.

    Example 77.209
  • tzstringrequired

    IANA zone (Asia/Kolkata) or an offset (+05:30). Past rule changes and daylight saving are handled.

    Example Asia/Kolkata
  • langstring

    Language of names and labels: en, hi, mr, bn, te, gu, ta, pa, kn, ml, en_IN (Hinglish) or de. Default en.

    Example en
  • ayanamsastring

    Ayanamsa. Lahiri (chitrapaksha) is the only one today and the default. Any other value gets 400 unsupported_ayanamsa.

    One of lahiri
  • stylestring

    Chart style. Default north.

    Example northOne of north, south, east
  • formatstring

    Image format. Default svg. PNG comes back as png_url, a link that works for an hour.

    Example svgOne of svg, png
  • sizeinteger

    PNG width and height in pixels, 150 to 2000. Values outside are clamped. Default 600.

    Example 600

Birth fields are the same on every chart endpoint. Times are local to the place; pass the zone in tz and we handle past rule changes and daylight saving.

Response

JSON with 200 OK. Every answer carries units (how many API calls this request counts as) and request_id, and the same values in the X-Units and X-Request-Id headers. The example below is the real answer to the request shown.

  • birthobjectThe birth you sent, with the UTC offset used at that moment.
  • chartstringThe chart you asked for.
  • formatstringsvg or png.
  • langstringLanguage of names and labels.
  • stylestringChart style.
  • svgstringThe chart as an SVG string (shortened here).
  • unitsnumberHow many API calls this request counts as: 1, or 5 for a heavy call; 0 for errors and free endpoints.
  • request_idstringId of this call. Search it in Request logs. Also sent as the X-Request-Id header.

With "format": "png", the answer has png_url, expires_in and width in place of svg. See the PNG tab on the example.

Errors

  • 400
    Codesinvalid_jsoninvalid_datetimeinvalid_latinvalid_loninvalid_tzunsupported_ayanamsainvalid_chartinvalid_styleinvalid_formatunsupported_langinvalid_end_user
    WhenA field is missing or invalid. The message names the field.
  • 401
    Codesmissing_keyunknown_key
    WhenNo key, or the key is wrong, revoked or past its rotation window.
  • 403
    Codesnot_allowed
    WhenThe key has an allow list and this call came from another IP or domain.
  • 404
    Codesno_such_endpoint
    WhenWrong path or method.
  • 429
    Codesrate_limitedmonthly_limitspend_cap
    WhenOver a limit. Wait the Retry-After seconds before trying again.
  • 502
    Codesengine_unavailableengine_error
    WhenOur engine could not answer. Retry with backoff.

Errors are never charged. Every error has one shape: { "error": "<message>", "code": "<code>", "request_id": "req_..." }. Errors and limits