🕓 記録: 2026-04-14、更新: 2026-05-09。 TS / Python / PHP SDK は現在 public registries にあります -
@astroway/sdk(npm),astroway(PyPI),astroway/sdk(Packagist)。 詳細は changelog。
コードからネイタルチャートを計算したいんだね。最短ルートはこれだよ - 5分でゼロから動く JSON が手に入る。
ステップ 1: APIキーを取得(30秒)
Section titled “ステップ 1: APIキーを取得(30秒)”api.astroway.info/dashboard/sign-up にサインアップしよう。無料プラン: 10 000 クレジット / 月。カード不要。
dashboard で「Create key」→「Production」をクリックしてコピー。キーは aw_live_aB3xY7pQ9rN2mK4jH8vC5tL6wZ1fD0eR のような形式です。
ヒント: プレフィックス aw_test_ のサンドボックスキーもあるよ - クレジットは消費されない。開発時に使ってね。
ステップ 2: SDKをインストール
Section titled “ステップ 2: SDKをインストール”TypeScript
Section titled “TypeScript”npm install @astroway/sdkPython
Section titled “Python”pip install astroway両方の SDK はすべての 758 エンドポイントを型付けされたリクエストとレスポンスでカバーしている。
ステップ 3: 最初のネイタルチャート
Section titled “ステップ 3: 最初のネイタルチャート”TypeScript
Section titled “TypeScript”import { Astroway } from '@astroway/sdk';
const aw = new Astroway({ apiKey: process.env.ASTROWAY_API_KEY!,});
const chart = await aw.chart.compute({ date: '1990-07-14', time: '14:30:00', timezoneOffset: 3, // UTC+3, літо в Києві latitude: 50.4501, longitude: 30.5234, houseSystem: 'P', // Placidus});
const SIGNS = ['Aries', 'Taurus', 'Gemini', 'Cancer', 'Leo', 'Virgo', 'Libra', 'Scorpio', 'Sagittarius', 'Capricorn', 'Aquarius', 'Pisces'];
const sun = chart.planets.find((p) => p.name === 'Sun')!;console.log(`Sun: ${SIGNS[Math.floor(sun.longitude / 30)]} at ${sun.longitude.toFixed(2)}°`);console.log(`ASC: ${chart.houses.ascendant.toFixed(2)}°`);console.log(`Aspects: ${chart.aspects.length}`);実行:
ASTROWAY_API_KEY=aw_live_... npx tsx chart.tsファイルはトップレベル await を使用しているので、package.json に "type": "module" を設定しておく必要がある。そうしないと tsx が Top-level await is currently not supported with the "cjs" output format で失敗する。
Python
Section titled “Python”from astroway import Astroway, BirthData
aw = Astroway(api_key="aw_live_your_key_here")
chart = aw.chart.compute(BirthData( date="1990-07-14", time="14:30:00", timezone_offset=3, latitude=50.4501, longitude=30.5234, house_system="P",))
SIGNS = ["Aries", "Taurus", "Gemini", "Cancer", "Leo", "Virgo", "Libra", "Scorpio", "Sagittarius", "Capricorn", "Aquarius", "Pisces"]
sun = next(p for p in chart["planets"] if p["name"] == "Sun")print(f"Sun: {SIGNS[int(sun['longitude'] // 30)]} at {sun['longitude']:.2f}°")print(f"ASC: {chart['houses']['ascendant']:.2f}°")print(f"Aspects: {len(chart['aspects'])}")実行:
ASTROWAY_API_KEY=aw_live_... python3 chart.pyAPIの返却内容
Section titled “APIの返却内容”JSON オブジェクトが返され、4つの主要セクションが含まれる:
planets
Section titled “planets”13 個のオブジェクトからなる配列。name には Swiss Ephemeris の天体名が入る: Sun, Moon, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto, true Node(北交点), mean Apogee(リリス), Chiron。
{ "id": 0, "name": "Sun", "longitude": 354.702, // еклiптична довгота у градусах "latitude": -0.00016, "distance": 0.9945, // в астрономічних одиницях "speedLong": 0.9971, // градусів на день (від'ємне = ретроград) "speedLat": 0.00003, "speedDist": 0.00019, "isRetrograde": false, "declination": -1.4159, "rightAscension": 355.437}サインとハウスはここには含まれないので、サインは Math.floor(longitude / 30)、ハウスは houses のカスピッドで計算してね。
houses
Section titled “houses”ハウスのカスピッド(12 個)と、asc と MC が含まれる:
{ "system": "P", "cusps": [118.18, 138.27, ...], // 12 значень "ascendant": 118.18, "mc": 12.708, "armc": 11.69, "vertex": 253.97, "equatorialAsc": 100.75, "coAscWK": 81.13, "coAscMunkasey": 123.7, "polarAsc": 261.13}aspects
Section titled “aspects”惑星間のアスペクトの配列:
{ "planet1": "Sun", "planet2": "Mercury", "planet1Id": 0, "planet2Id": 2, "type": { // об'єкт, не рядок "name": "Conjunction", "i18nKey": "aspect_conjunction", "angle": 0, "orb": 12, "symbol": "☌", "isMajor": true, "color": "#660480" }, "exactAngle": 3.365, "orb": 3.365, // відхилення від точного у градусах "isApplying": true}chartSect
Section titled “chartSect”"diurnal"(出生時に太陽が地平線上)または "nocturnal"(地平線下)。古典占星術で使用される。
次に何をすべきか
Section titled “次に何をすべきか”他に試すこと:
シナストリー: 2 人の相性:
const synastry = await client.synastry({ chart1: { date: '1990-07-14', time: '14:30:00', timezoneOffset: 3, latitude: 50.45, longitude: 30.52 }, chart2: { date: '1992-03-22', time: '09:15:00', timezoneOffset: 2, latitude: 48.85, longitude: 2.35 },});console.log(`Compatibility score: ${synastry.compatibility.score}/100`);現在のトランジット(ネイタルチャート向け):
const transits = await client.transits({ // дані народження date: '1990-07-14', time: '14:30:00', timezoneOffset: 3, latitude: 50.4501, longitude: 30.5234, // дата транзиту transitDate: '2026-04-14',});実際のトランジットからのデイリーホロスコープ:
const horoscope = await client.horoscopeDaily({ date: '1990-07-14', time: '14:30:00', timezoneOffset: 3, latitude: 50.4501, longitude: 30.5234,});console.log(horoscope.text);完全な Human Design マップ:
const hd = await client.humanDesign({ date: '1990-07-14', time: '14:30:00', timezoneOffset: 3, latitude: 50.4501, longitude: 30.5234,});console.log(`${hd.type} - ${hd.strategy} - Profile ${hd.profile}`);クレジット消費量
Section titled “クレジット消費量”- ネイタルチャート (
/chart): 20 クレジット - シナストリー: 50 クレジット
- トランジット: 50 クレジット
- デイリーホロスコープ: 20 クレジット
- Human Design: 50 クレジット
無料プラン: 10 000 クレジット / 月 = 500 件のネイタルチャート、または 200 件のシナストリー、または混合利用。
エラーハンドリング
Section titled “エラーハンドリング”各レスポンスにはクレジット情報がヘッダーに含まれる:
X-Credits-Used: 20X-Credits-Remaining: 4980X-Credits-Reset: 2026-05-01T00:00:00Zクレジットがなくなると 402 Payment Required が返る。レートリミットに達すると(Free: 10 リクエスト / 分)429 Too Many Requests が返り、ヘッダーに Retry-After が含まれる。
SDK は型付けされたエラーをスローするので、キャッチできる:
import { QuotaExceededError, RateLimitError } from '@astroway/sdk';
try { const chart = await aw.chart.compute(birth);} catch (err) { if (err instanceof QuotaExceededError) { console.log('Upgrade plan or wait for reset'); } else if (err instanceof RateLimitError) { console.log(`Retry in ${err.retryAfterSeconds ?? 60} seconds`); } else { throw err; }}具体的なエラーから一般的なエラーへ順にキャッチすべきだ。すべては ApiError を継承しているので、最初にそれをチェックすれば他のエラーを捕捉できる。
これで終わり
Section titled “これで終わり”これで君は以下を手に入れた:
- 動作する API キー
- インストール済み SDK
- 最初のネイタルチャート
- シナストリー、トランジット、ホロスコープを追加するための十分なサンプル
さらに読む:
- 完全ガイド「はじめに」: 詳細情報
- 例: ネイタルチャート: より深いウォークスルー
- API reference: すべての 758 エンドポイント
Solar Fireと同じSwiss Ephemeris - 4行のコードで。
無料のキー(カード不要)。最初の支払いまでに月5,000回の呼び出し。