Site key for a verified WordPress site
curl -X POST https://api.astroway.info/v1/site-keys \ -H "Content-Type: application/json" \ -d '{ "site_url": "https://example.com", "proof_id": "3f1c2a9e-8b7d-4c1e-9f3a-2b6d5e4c1a07", "proof": "q3v1Zk0yX2h8sR5tPwL9mN4bD7cF6gH1jK2lE0aS3uT", "plugin_version": "2.1.0" }'const res = await fetch('https://api.astroway.info/v1/site-keys', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ "site_url": "https://example.com", "proof_id": "3f1c2a9e-8b7d-4c1e-9f3a-2b6d5e4c1a07", "proof": "q3v1Zk0yX2h8sR5tPwL9mN4bD7cF6gH1jK2lE0aS3uT", "plugin_version": "2.1.0" }),});const { ok, data, error } = await res.json();if (!ok) throw new Error(error.message);console.log(data);import os, requests
r = requests.post( 'https://api.astroway.info/v1/site-keys', headers={'Content-Type': 'application/json'}, json={ 'site_url': "https://example.com", 'proof_id': "3f1c2a9e-8b7d-4c1e-9f3a-2b6d5e4c1a07", 'proof': "q3v1Zk0yX2h8sR5tPwL9mN4bD7cF6gH1jK2lE0aS3uT", 'plugin_version': "2.1.0" },)result = r.json()if not result['ok']: raise RuntimeError(result['error']['message'])print(result['data'])<?phpuse GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://api.astroway.info/v1/']);$r = $client->post('site-keys', [ 'json' => [ 'site_url' => 'https://example.com', 'proof_id' => '3f1c2a9e-8b7d-4c1e-9f3a-2b6d5e4c1a07', 'proof' => 'q3v1Zk0yX2h8sR5tPwL9mN4bD7cF6gH1jK2lE0aS3uT', 'plugin_version' => '2.1.0', ],]);$result = json_decode($r->getBody(), true);if (!$result['ok']) throw new \RuntimeException($result['error']['message']);print_r($result['data']);Issues a key to a site that proves it controls its domain: we fetch the proof from the site’s REST route (/wp-json/astroway/v1/verify?nonce=<proof_id>, or verify_url for plain permalinks) and compare it with the one sent. The key is bound to the host, covers a free set of readings and shares 300 calls an hour with the other installs on the host (at most 5). One key per install (host + home path): a new key for the same install revokes the previous one. Server-side only. No API key needed.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ”Comma-separated dotted paths, relative to data, to keep in the response. A path is applied to every element of an array, so planets.name means the name of each planet. Paths that match nothing come back in _fields_unmatched; a list where nothing matches at all is a 400, because an empty object would be a confident wrong answer.
Example
planets.name,planets.longitudeRound every non-integer number in the response to this many decimal places. Integers are left alone, because an id is not a measurement. Ecliptic longitudes ship with fourteen decimals by default; 2 is about a tenth of an arcminute.
Example
4Request Body required
Section titled “Request Body required ”object
The site home URL, https only. A subdirectory multisite uses the network home.
UUID v4 the plugin generated for this attempt.
32 random bytes, base64url. The site must serve the same value at its verify route.
The verify REST route when /wp-json/ is not available, e.g. https://example.com/?rest_route=/astroway/v1/verify. Same host as site_url.
Example
{ "site_url": "https://example.com", "proof_id": "3f1c2a9e-8b7d-4c1e-9f3a-2b6d5e4c1a07", "proof": "q3v1Zk0yX2h8sR5tPwL9mN4bD7cF6gH1jK2lE0aS3uT", "plugin_version": "2.1.0"}Responses
Section titled “ Responses ”Successful calculation
object
object
object
Example
{ "ok": true, "data": { "key": "aw_live_…", "plan": "site", "domain": "example.com", "home_path": "/", "limits": { "per_hour": 300 }, "endpoints": [ "public/chart", "public/horoscope/*", "natal-texts", "…" ], "replaced_previous": false }}Validation error
Example
{ "ok": false, "error": { "code": "INVALID_INPUT", "message": "Validation failed: date: Date must be YYYY-MM-DD", "details": [ { "path": "date", "message": "Date must be YYYY-MM-DD" } ] }}Missing or invalid API key
Example
{ "ok": false, "error": { "code": "INVALID_API_KEY", "message": "Invalid API key" }}