Public API · miễn phí

AmLichVietnam Public API cho AI agent

API miễn phí, không cần API key. Chỉ trả field free + source_url để trích dẫn. Gói trả phí, ảnh HD không watermark và PDF là sắp ra mắt. Người dùng tự mở /nang-cap. Gói API không gồm chat web. Agent không tự thanh toán. Xem bản Markdown.
Base URLhttps://amlichvietnam.vn/api/public/v1

Khám phá

Giới hạn

  • 60

    request / phút / IP

  • 2.000

    request / ngày / IP

  • *

    CORS Access-Control-Allow-Origin

Vượt hạn → 429 + Retry-After + header RateLimit-*

Endpoints (operationId ≈ MCP tool)

health và plans chỉ có REST. Các operationId khác khớp tên MCP tool (23 tools). Ảnh lá số free là 1080px có watermark. HD không watermark sắp ra mắt.

Health

health
  • GET

    /health

    health·Health check

Lịch âm

lunar
  • GET

    /lunar/today

    get_lunar_today·Vietnamese lunar calendar — today

  • GET

    /lunar/convert

    convert_lunar_date·Convert solar ↔ lunar date

  • GET

    /lunar/month

    get_lunar_month·Lunar calendar month grid

Ngày tốt

good-days
  • GET

    /good-days

    find_good_days·Find auspicious days

  • GET

    /good-days/check

    check_good_day·Score one auspicious day

  • GET

    /good-days/wedding

    good_day_wedding·Wedding days (cuoi-hoi), one list per birth year

Tử vi

tu-vi
  • POST

    /tu-vi/summary

    get_tuvi_summary·Zi Wei (Tử Vi) free summary

  • POST

    /tu-vi/image

    tuvi_image·Watermarked Tu Vi chart image (1080). HD is sắp ra mắt.

  • POST

    /tu-vi/detail

    tuvi_detail·Detailed Zi Wei reading. Free callers receive upgrade_required. Paid plans are sắp ra mắt until checkout is on.

  • GET

    /charts

    list_charts·List saved charts. api_plus/api_pro. Birth date is omitted.

  • POST

    /charts

    save_chart·Save a chart. consent must be true. api_plus/api_pro.

  • DELETE

    /charts/{id}

    delete_chart·Delete a saved chart owned by the key.

  • POST

    /share-links

    create_share_link·Create a share link. Free: 3 per month. Token is returned once.

  • DELETE

    /share-links/{id}

    revoke_share_link·Revoke a share link owned by the caller.

Bát tự

bat-tu
  • POST

    /bat-tu/summary

    get_bazi_summary·BaZi (Bát Tự) free summary

Hợp tuổi

hop-tuoi
  • GET

    /hop-tuoi

    check_age_compatibility·Age / zodiac year compatibility

  • GET

    /hop-tuoi/xay-nha

    check_build_house_age·Build-house age check

Tình duyên

tinh-duyen
  • POST

    /tinh-duyen/summary

    get_love_compatibility·Love compatibility (free)

Thần số

than-so
  • POST

    /than-so/summary

    get_numerology_summary·Numerology free summary

  • POST

    /than-so/compatibility

    get_numerology_compatibility·Numerology pair compatibility

Mệnh

menh
  • GET

    /menh

    get_menh_by_year·Element / nạp âm by birth year

Kiến thức

knowledge
  • GET

    /knowledge/search

    search_knowledge·Search knowledge articles

  • GET

    /knowledge/articles

    list_knowledge_articles·List knowledge articles

  • GET

    /knowledge/articles/{category}/{slug}

    get_knowledge_article·Get knowledge article

  • GET

    /knowledge/categories

    list_knowledge_categories·List knowledge categories

Gói

plans
  • GET

    /me/quota

    check_quota·Remaining quota for the API key

  • GET

    /upgrade-link

    get_upgrade_link·Upgrade link. Paid plans are sắp ra mắt.

  • GET

    /plans

    plans·Public plan defaults. Paid checkout is sắp ra mắt.

MCP quickstart

  1. initialize
  2. tools/list
  3. tools/call (vd get_lunar_today)

Endpoint /mcp — Streamable HTTP POST, stateless, không cần Mcp-Session-Id, 23 tools. Key gửi header Authorization: Bearer. Khi client không thêm được header, dán mã chat vào hội thoại để AI truyền access_code. GET trả 405. Thẻ khám phá: server-card.

MCP client config
{
  "mcpServers": {
    "amlichvietnam": {
      "url": "https://amlichvietnam.vn/mcp"
    }
  }
}

Enum

  • good-days category: cuoi-hoi, khai-truong, dong-tho, xuat-hanh, mua-nha, nhap-trach, cau-an, mua-xe, sinh-con, an-tang
  • hop-tuoi purpose: vo-chong, lam-an, lay-vo, lay-chong
  • gender: nam | nu

Ví dụ curl

curl
curl -s "https://amlichvietnam.vn/api/public/v1/lunar/convert?date=2026-02-17&direction=solar_to_lunar"

curl -s -X POST "https://amlichvietnam.vn/api/public/v1/bat-tu/summary" \
  -H "Content-Type: application/json" \
  -d '{"birth_date":"1990-05-15","birth_time":"09:30","gender":"nam","region":"north"}'

Envelope

Mọi response 200 gồm các field dưới đây. source luôn là AmLichVietnam.vn. tier hiện luôn là "free" (schema còn api_plus và api_pro). upgrade_url luôn có và trỏ tới /nang-cap. generated_at theo ICT.

  • data
  • source
  • source_url
  • tool
  • tier
  • method_note
  • upgrade_url
  • disclaimer
  • attribution
  • algorithm_version
  • generated_at

Trích dẫn

Khi dùng dữ liệu, ghi Nguồn: AmLichVietnam.vn và dẫn source_url trong response.

Content-Signal

ai-train=no, search=yes, ai-input=yes

Được phép dùng làm đầu vào agent / tìm kiếm; không dùng để train model.

Widget nhúng

Dán một thẻ script. Script tìm phần tử data-type="lich-am" hoặc data-type="ngay-tot" và tạo iframe. Không cookie, không tracking, không request nào ngoài iframe.

  • lich-am → /embed/lich-am
  • ngay-tot → /embed/ngay-tot (noindex)
  • data-theme: light hoặc dark
HTML
<script src="https://amlichvietnam.vn/widget.js" data-type="ngay-tot" data-theme="light" async></script>

<div data-type="lich-am" data-theme="light"></div>
<script src="https://amlichvietnam.vn/widget.js" async></script>

Link ghi nguồn trong iframe là anchor AmLichVietnam.vn tới trang đầy đủ. Production bật bằng NEXT_PUBLIC_FEATURE_WIDGET_JS.

Changelog

  • 2026-11-16: REST GET /charts và DELETE /charts/{id}. Lưu lá số cần đồng ý. Danh sách không hiện ngày giờ sinh.
  • 2026-11-16: REST POST /share-links và DELETE /share-links/{id}. Trang chia sẻ noindex, follow. Mặc định không hiện ngày giờ sinh.
  • 2026-11-16: 23 MCP tools, thêm tuvi_detail, check_quota, save_chart. Free nhận upgrade_required. Nâng cấp tại /nang-cap. Gói trả phí sắp ra mắt.
  • 2026-11-15: 20 MCP tools, thêm tuvi_image, good_day_wedding, get_upgrade_link. REST POST /tu-vi/image, GET /good-days/wedding, GET /upgrade-link, GET /plans. Nâng cấp tại /nang-cap. Gói trả phí sắp ra mắt.
  • 2026-10-31: API index GET /api/public/v1; robots Google-Extended Allow docs + SEO; /docs → /developers; MCP + list_knowledge_categories; /developers.md + security.txt.