# Zapier

Zap lấy ngày, giờ, múi giờ và tọa độ sinh từ trigger, gọi API bản đồ và chuyển đổi Ascendant thành tên dấu zodiac. Yêu cầu dưới đây đã được gửi đến sản xuất chính xác ở dạng mà bước tạo ra; các bước trong Zapier được viết theo tài liệu Zapier ngày 2026-09-17.

<Aside type="caution" title="Потрібен платний тариф Zapier">
API by Zapier, Webhooks by Zapier và Formatter là các ứng dụng premium. Tài liệu Zapier đánh dấu cả ba là không khả dụng trên gói Free, và bước Lookup Table yêu cầu gói Professional hoặc cao hơn. Trên gói Free, hãy sử dụng [Make](/integrations/make/) hoặc [n8n](/integrations/n8n/).
</Aside>

Sпершу створіть ключ, як описано в розділі [Ключ для автоматизації](/integrations/#ключ-для-автоматизації), з областю `chart`.

## 1. Place the key in the connection
Headers entered in the Webhooks by Zapier step are stored in the step itself, and anyone with access to Zap can see them. API by Zapier keeps them in the connection.

1. On the **Apps** page, click **+ Add connection** and select **API by Zapier**.
2. **Authentication type**: Static Headers (API key).
3. **Headers**: `X-Api-Key: ` followed by your key, all on one line.
4. **Domain filter**: `api.astroway.info`, so the connection cannot be redirected elsewhere.

## 2. Call the chart
Add an action, select **API by Zapier**, the **API Request** event, and the connection.

- **Method**: `POST`.
- **URL**:

  ```
  https://api.astroway.info/v1/chart
  ```

- **Body**: JSON below with trigger fields instead of values.

```json
{
  "date": "1990-05-15",
  "time": "14:30:00",
  "timezone": "Europe/Kyiv",
  "latitude": "50.45",
  "longitude": "30.52"
}
```

Replace each value with the corresponding trigger field and keep quotes around each, numbers too. Zapier inserts the mapped field as plain text and does not add quotes itself, and the API accepts `"50.45"` as a number. Do not add the key in the step Headers: it is substituted by the connection.

Test the step. The correct response begins with `"ok": true`, and `data.input.timezoneOffset` for example equals `4`: the offset that Kyiv had that day.

## 3. Convert Ascendant to sign
Two Formatter steps.

**Formatter, Numbers event, Spreadsheet-Style Formula conversion.** Formula:

```
FLOOR(ASCENDANT / 30)
```

where instead of `ASCENDANT` substituted `data.houses.ascendant` from step 2. For example, it yields `5`.

**Formatter, Utilities event, Lookup Table conversion.** Lookup Key is the formula result. Table:

| Key | Value |
|---|---|
| 0 | Aries |
| 1 | Taurus |
| 2 | Gemini |
| 3 | Cancer |
| 4 | Leo |
| 5 | Virgo |
| 6 | Libra |
| 7 | Scorpio |
| 8 | Sagittarius |
| 9 | Capricorn |
| 10 | Aquarius |
| 11 | Pisces |

For example, result is `Virgo`. To get Ukrainian names, write them in the Value column.

Sun and Moon are calculated the same way. They are the first and second entries in `data.planets`, each with its own `longitude`: for example 54.34 (Taurus) and 296.39 (Capricorn).

## Nếu bạn đang sử dụng Webhooks by Zapier
Hoạt động, nhưng khóa nằm trong bước, không trong kết nối. Đối với bản đồ, chọn sự kiện **Custom Request**: nó gửi trường Data chính xác như được nhập, vì vậy JSON ở trên sẽ đi không thay đổi. Đặt **Method** là `POST`, và trong **Headers** thêm cả `X-Api-Key` với khóa của bạn và `Content-Type` có giá trị `application/json`.

## Khi bước thất bại
- **`400 INVALID_FIELD` з `timezone` у `details`**: múi giờ được trùng khớp là rỗng, đây là một viết tắt như `EST` hoặc không phải tên múi giờ.
- **`400` з `date` чи `time` у `details`**: định dạng trigger không phải `YYYY-MM-DD` / `HH:MM:SS`; hãy thêm bước Formatter cho ngày trước khi gọi.
- **`403 ENDPOINT_NOT_IN_SCOPE`**: phạm vi của key không chứa `chart`.
- **`429 KEY_BUDGET_EXHAUSTED`**: key đã cạn ngân sách của mình; tăng nó lên trong bảng điều khiển.

API does not geocode. If the trigger only has a place name, coordinates must come from the trigger itself or from a geocoding service for which you have a key.
