Docs

126 functions, by name.

From the download to a chart in your product. The guide, the online API, and every function by the name you know.

Start hereThe API

126functions

106by the names you know

35new ones

18,970,025places included, each on its own clock

Start here

Download to first chart.

OCO's own orbits, on the device. The planets, the houses and the birth hour. No server. No WASM. No dependencies. Version oco-28-2026-11-14 · time zones 2026f.

Prove it (30 seconds)

Your machine recomputes our own orbits at 600 instants, one a year from 1800 to 2399, eleven bodies, and meets our seal bit for bit. Beside each body: how far NASA JPL Horizons sits from ours. Exit code 0 = verified.

node verify/verify.mjs

A chart (12 lines)

A clock that happened twice (summer time ends) or never (it starts) returns { question }, never a guess. Ask the person; pass choice: 'first' | 'second'.

From what a person types instead of coordinates: any place on Earth, by any name it ever bore. 18,970,025 places and 46,237,805 names, each place on its own clock. openWorld() reads our copy one shard at a time; the name searched for never leaves your code.

No network at run time: node world-mirror.mjs ./world copies it once (9,512 files, 5.3 GB), then openWorld({ dir: './world' }).

node examples/chart.mjs
import { open, openTimezones, chart } from './ocoephemeris-sdk/node.mjs';

const eph = await open();          // 1800 – 2399 loaded, 0.1 s
const tz  = await openTimezones(); // the birth hour, read from the law

const c = chart(eph, tz, {
  date: '1990-07-04', time: '14:30', zone: 'America/New_York',
  lat: 40.7128, lon: -74.0060, house: 'P',
});
// c.bodies → Sun 12°31′ Cancer … · c.houses.asc → 28°27′ Libra
node examples/place.mjs "Kashgar" 1980-05-01 12:00
node examples/place.mjs "Königsberg" 1930-06-01 12:00
const world = await openWorld();                 // or openWorld({ dir: './world' }) after the copy below
const [best] = await world.search('Kashgar');
const c = chart(eph, tz, { date: '1980-05-01', time: '12:00', place: best });
// Kashgar's records of 1980 were kept on Ürümqi time, not Beijing's: the chart follows the state's clock.
// world.search('Königsberg') → Kaliningrad, Europe/Kaliningrad, „Königsberg" 1255 to 1946

The full API

The calls you already know, by the names you already know:

Coming from Swiss Ephemeris: MIGRATING-FROM-SWISS.md, call by call. Every one of its calls answers; the fixed stars, heliacal visibility and the date arithmetic are in extras.mjs.

import { open, BODY, FLAG } from './ocoephemeris-sdk/node.mjs';
const eph = await open();

const jd  = eph.julday(1990, 7, 4, 18.5);                 // UT
const sun = eph.calcUt(jd, BODY.SUN);                      // lon, lat, dist, speeds, retrograde, floor, source
const eq  = eph.calcUtWithFlags(jd, BODY.MOON, FLAG.EQUATORIAL);
const h   = eph.houses(jd, 40.7128, -74.006, 'K');        // 23 systems: A B C D F G H I K L M N O P Q R S T U V W X Y (E = A)
eph.setSiderealMode(1);                                     // 47 ayanamshas; 1 = Lahiri
const sid = eph.calcUtWithFlags(jd, BODY.MOON, FLAG.SIDEREAL);
const next = eph.nextSolarEclipse(jd);                      // 1,423 of 1,423 on the five-millennium canon

In the browser

Serve this folder as static files. Nothing else.

examples/browser.html is a working page.

<script type="module">
  import { open, openTimezones, chart } from './ocoephemeris-sdk/index.mjs';
  const eph = await open({ jdFrom: 2451545, jdTo: 2451545 }); // load one block, ~0.5 MB
  await eph.needDate(1987, 3, 21);                              // fetch a birth's block when you need it
</script>

What is in the box

Planets, Sun, MoonOCO's own orbits, integrated here, 1550 – 2650. Every answer's source says so.
PointsTrue and mean node, both Liliths, Chiron, Pholus, Ceres, Pallas, Juno, Vesta.
Houses23 systems, with cusp speeds.
Sidereal47 ayanamshas.
EventsEclipses, occultations, rise and set, ingresses and crossings.
HoursIANA 2026f, full backzone, plus corrections read from the statute books.
Same answer everywhereThe same bits on Chrome, Safari, Node and every phone.
PlacesThe world: 18,970,025 places, 46,237,805 names, each place with its time zone (openWorld()). Offline after one copy: node world-mirror.mjs ./world (5.3 GB). Show the credit.
Window1800 – 2399 in the box.

Help

hello@astrocogy.com. Send the output of node verify/verify.mjs with any question.

Hosted API

Call it from anything.

Four calls

Four calls, one address: astrocogy.com/api/v1 serves a product in any language. POST a JSON object from your server, with your key in the header. A key in a web page is a key shared: in a browser, ship the SDK.

CallSendGet
/api/v1/placesquery, limitPlaces, each with its place_id, coordinates and zone
/api/v1/birth-timeplace_id, date, timeThe hour in UTC, by the clock the law set that day
/api/v1/skyutc, latitude, longitude, house_systemEvery body: sign, position, speed, house
/api/v1/chartplace_id, date, time, house_systemThe hour and the whole chart

One call, one answer

The birth hour of Calcutta, 1 November 1946, noon: the clock was 6½ hours ahead of UTC that day.

curl https://astrocogy.com/api/v1/birth-time \
  -H "Authorization: Bearer oco_..." \
  -d '{"place_id":-2092511,"date":"1946-11-01","time":"12:00"}'
{"local":"1946-11-01 12:00","status":"ok","utc":"1946-11-01T05:30:00Z","offset_hours":6.5,"abbreviation":"+0630", ...}

Limits, keys, privacy

  • Limits. 1,000,000 calls a month are included, and no call is charged. Past that, calls still answer.
  • Bursts. Over 500 calls in 10 seconds gets a 429 and Retry-After: 10. Back off and retry.
  • An ended key keeps answering for 30 days, with an OCO-Licence header on each answer. Then it stops with a 401.
  • Errors. A wrong input: 400, and what to fix. A bad key: 401.
  • Privacy. A birth passes through our server to be computed. Nothing stores it or forwards it. A log line names the key and the call, never the birth.
  • The key comes by email with your Company licence. The terms are the licence: astrocogy.com/ocoephemeris/licence

From Swiss Ephemeris

Every call, by its name.

Same body numbers. Same flag numbers. Same house letters. The calls keep their names without the swe_ prefix, in camelCase. All 106 calls of Swiss Ephemeris 2.10.03 answer. The chart's calls are methods of eph (index.mjs, node.mjs); the fixed stars, heliacal visibility and the date and degree arithmetic are functions of extras.mjs.

Call by call

All 39 rows
Swiss EphemerisocoEphemerisNote
swe_set_ephe_path(path)·Nothing to set. The data is in data/.
swe_julday(y, m, d, h, SE_GREG_CAL)eph.julday(y, m, d, h)Gregorian.
swe_utc_to_jd(...)eph.utcToJd(y, m, d, h, mi, s)Returns { jdTt, jdUt1 }.
swe_calc_ut(jd, ipl, iflag, xx, serr)eph.calcUtWithFlags(jd, ipl, iflag)Returns { lon, lat, dist, lonSpeed, latSpeed, distSpeed, retrograde, floor, source }.
swe_calc(jd_tt, ...)eph.calcTt(jdTt, ipl, iflag)
swe_houses(jd, lat, lon, hsys, cusps, ascmc)eph.houses(jd, lat, lon, hsys)cusps[0] is house 1 (Swiss: cusps[1]). asc, mc, armc, vertex, equAsc, coAscKoch, coAscMunkasey, polarAsc by name.
swe_houses_ex(..., SEFLG_SIDEREAL, ...)eph.houses(jd, lat, lon, hsys, FLAG.SIDEREAL)
swe_houses_armc(...)eph.housesArmc(armc, lat, eps, hsys)
swe_houses_ex2 (cusp speeds)eph.housesWithSpeeds(...)
swe_house_pos(...)eph.housePos(...)
swe_house_name(hsys)eph.houseName(hsys)
swe_set_sid_mode(mode, t0, ayan_t0)eph.setSiderealMode(mode, t0, ayanT0)47 modes, Swiss numbering. 1 = Lahiri.
swe_get_ayanamsa_ut(jd)eph.ayanamsha(jd)
swe_get_planet_name(ipl)eph.planetName(ipl)
swe_set_topo(lon, lat, h)eph.setTopo(lon, lat, h)
swe_rise_trans(...)eph.riseTrans(...)
swe_sol_eclipse_when_glob(...)eph.nextSolarEclipse(jd, backward, type)Swiss type bits.
swe_lun_eclipse_when(...)eph.nextLunarEclipse(jd, backward, type)
swe_sol_eclipse_when_loc(...)eph.solarEclipseLocal(...)
swe_lun_occult_when_loc(...)eph.occultationLocal(...)
swe_pheno_ut(...)eph.pheno(...)
swe_solcross_ut(...) · swe_mooncross_ut(...)eph.solcrossUt(...) · eph.mooncrossUt(...)Ingresses.
swe_nod_aps_ut(...)eph.nodesApsides(...)
swe_get_orbital_elements(...)eph.orbitalElements(...)
swe_deltat(jd)eph.deltaT(jd)IERS Bulletin A.
swe_sidtime(jd)eph.siderealTime(jd)IAU 2006.
swe_azalt(...) · swe_azalt_rev(...)eph.azalt(...) · eph.azaltRev(...)
swe_refrac(...)eph.refraction(...)
swe_close()eph.close()
swe_fixstar_ut(star, jd, iflag) · swe_fixstar2_utfixstar(eph, star, jd, iflag)extras.mjs. Gaia EDR3.
swe_fixstar(star, jd_tt, iflag) · swe_fixstar2fixstarTt(eph, star, jdTt, iflag)
swe_fixstar_mag(star) · swe_fixstar2_magfixstarMag(star)
swe_heliacal_ut · swe_heliacal_pheno_ut · swe_vis_limit_magheliacalUt(eph, …) · heliacalPhenoUt(eph, …) · visLimitMag(eph, …)extras.mjs.
swe_heliacal_angle · swe_topo_arcus_visionisheliacalAngle(…) · topoArcusVisionis(…)
swe_set_lapse_rate(r)airColumn(h, { lapseRate })A per-call option, never a global.
swe_revjul · swe_day_of_week · swe_date_conversionrevjul · dayOfWeek · dateConversionextras.mjs.
swe_utc_time_zone · swe_jdet_to_utc · swe_jdut1_to_utcutcTimeZone · jdetToUtc · jdut1ToUtc
swe_cotrans · swe_cotrans_sp · swe_sidtime0cotrans · cotransSp · sidtime0
swe_degnorm · swe_difdeg2n · swe_split_deg · swe_cs2degstr …degnorm · difdeg2n · splitDeg · cs2degstr …The rest of the arithmetic, the same names.

What behaves differently, on purpose

  • No silent fallback. Swiss falls back to its Moshier model when a file is missing, and only the returned flags show it. ocoEphemeris refuses: a date outside this package's years throws EphemerisRangeError, naming the years, so your app can tell its user. A wrong chart is never drawn.
  • No dropped flags. A flag the call does not support is a TypeError, never ignored.
  • Errors are exceptions. No serr string, no negative return code.
  • The error travels with the number. Every position carries floor and source: how far it can be from the truth, and where it came from.
  • One answer on every device. The trigonometry is our own, so Safari, Chrome, Node and every phone print the same bits. Platform Math.sin differs between engines.
  • The birth hour. openTimezones() resolves a local clock through the time-zone history with the statute-book corrections. A clock that occurred twice or never is returned as a question.

Measured against Swiss Ephemeris 2.10.03

Every line has its test in the OCO repository.

TestSwiss EphemerisocoEphemeris
Rise and set vs IMCCE, 654 events0.141 s0.0041 s
Bytes a browser loads for one chart, 1800 – 23992.01 MB (three files)0.95 MB (one 22-year block; two at most)