🕓 記録日: 2026-04-14、更新日: 2026-05-09。 TypeScript / Python / PHP 用の SDK は、それぞれ
@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 クレジットが利用可能で、カード登録は不要です。
ダッシュボード で「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 も、すべての 723 エンドポイントに対応しており、型付きのリクエストとレスポンスを提供します。
ステップ 3: 初めてのホロスコープ
Section titled “ステップ 3: 初めてのホロスコープ”TypeScript
Section titled “TypeScript”import { Astroway } from '@astroway/sdk';
const client = new Astroway({ apiKey: process.env.ASTROWAY_API_KEY!,});
const chart = await client.chart({ date: '1990-07-14', time: '14:30:00', timezoneOffset: 3, // UTC+3、キエフの夏時間 latitude: 50.4501, longitude: 30.5234, houseSystem: 'P', // プラシダス});
console.log(`Sun: ${chart.planets[0].sign} at ${chart.planets[0].longitude}°`);console.log(`ASC: ${chart.houses.ascendant}°`);console.log(`Aspects: ${chart.aspects.length}`);実行:
ASTROWAY_API_KEY=aw_live_... npx tsx chart.tsPython
Section titled “Python”from astroway import Astroway
client = Astroway(api_key="aw_live_your_key_here")
chart = client.chart( date="1990-07-14", time="14:30:00", timezone_offset=3, latitude=50.4501, longitude=30.5234, house_system="P",)
print(f"Sun: {chart['planets'][0]['sign']} at {chart['planets'][0]['longitude']}°")print(f"ASC: {chart['houses']['ascendant']}°")print(f"Aspects: {len(chart['aspects'])}")実行:
ASTROWAY_API_KEY=aw_live_... python3 chart.pyAPI が返すデータ
Section titled “API が返すデータ”返ってくるのは、4つの主要なパートを含む JSON オブジェクトです。
planets
Section titled “planets”12個の天体(太陽、月、水星、金星、火星、木星、土星、天王星、海王星、冥王星、北ノード、キロン)を含む配列:
{ "name": "Sun", "longitude": 111.87, // 黄道経度(度) "latitude": 0.0, "speed": 0.955, // 1日あたりの度(マイナスは逆行) "sign": "cancer", "signIndex": 3, "house": 10, "retrograde": false}houses
Section titled “houses”12のハウス・カスプと、ASC(上昇点)、MC(中天)を含む:
{ "system": "P", "cusps": [12.34, 43.21, ...], // 12 値 "ascendant": 12.34, "mc": 280.12}aspects
Section titled “aspects”惑星間のアスペクトの配列:
{ "planet1": "Sun", "planet2": "Moon", "type": "sextile", // conjunction, opposition, trine, square, sextile, quincunx "orb": 1.36, // 正確な角度からのずれ(度) "applying": 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);フル・ヒューマンデザイン・チャート:
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 クレジット
- ヒューマンデザイン: 50 クレジット
無料プラン: 月間 10,000 クレジット = 500 ホロスコープ、または 200 シナストリー、あるいは組み合わせた利用が可能。
レスポンスには、クレジットに関するヘッダーが含まれています:
X-Credits-Used: 20X-Credits-Remaining: 4980X-Credits-Reset: 2026-05-01T00:00:00Zクレジットが不足すると 402 Payment Required が返ります。レートリミットに達すると(無料プラン: 1分あたり10リクエスト)、429 Too Many Requests と Retry-After ヘッダーが返ります。
SDK は型付きのエラーをスローするので、キャッチして処理できます:
try { const chart = await client.chart({ ... });} catch (err) { if (err.code === 'credits_exhausted') { console.log('Upgrade plan or wait for reset'); } else if (err.code === 'rate_limit_exceeded') { console.log(`Retry in ${err.retryAfter} seconds`); }}これで完了!
Section titled “これで完了!”今のあなたは:
- 動作する API キーを手に入れた
- SDK をインストールした
- 初めてのホロスコープを計算した
- シナストリー、トランジット、ホロスコープを追加するためのサンプルも手に入った
さらに詳しく:
- 「はじめに」完全ガイド — より詳細な情報
- サンプル: ホロスコープ — 詳細なウォークスルー
- API リファレンス — すべての 723 エンドポイント
Solar Fireと同じSwiss Ephemeris — 4行のコードで。
無料のキー(カード不要)。最初の支払いまでに月5,000回の呼び出し。