Baileys 與 QR code 登入 WhatsApp API 解説:優點、缺點與風險
Baileys and QR-Login WhatsApp APIs Explained: Pros, Cons and Risks
Baileys 等非官方 QR code 登入 WhatsApp API 服務價格低、啟用快,但不屬於 Meta 的 WhatsApp Business Platform。相較官方 Cloud API,這類服務可能導致帳號被封、缺乏支援,供應商亦可存取聊天內容。摘要比較兩種方案的連接方式、費用與風險,協助用戶瞭解取捨。
A QR-login "WhatsApp API" is a service that connects to WhatsApp by having you scan a QR code, then lets software send and read messages on that number. Many are built on open-source libraries such as Baileys, which is not an official Meta product. They are cheap and quick to start, but they sit outside WhatsApp's official business platform, so the trade-off is account bans, no support and a third party holding access to your chats.
This guide explains how these services work at a high level, what each side of the trade-off looks like, and how to decide. It does not contain setup code for any unofficial tool, and it does not help with bulk or unsolicited messaging.
Who this is for
This is for business owners, operations leads and developers, mostly in India but also elsewhere, who have been offered a "WhatsApp API" for a very low monthly price, or who found Baileys on GitHub and wonder whether it is a shortcut. After reading you will be able to tell which kind of service you are being sold, list the risks in plain words, and choose between the unofficial and official routes with your eyes open.
What Baileys is
Baileys is an open-source library hosted at github.com/WhiskeySockets/Baileys under the MIT license. Its README disclaimer is direct: "This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with WhatsApp". The maintainers also say they do not condone using it in ways that violate WhatsApp's Terms of Service, and they add: "Do not spam people with this. We discourage any stalkerware, bulk or automated messaging usage."
That last point matters. The library authors themselves warn against the use case that most resellers sell it for. A library is a building block, not a service: whoever runs it is responsible for how it is used, and for the safety of the sessions it holds.
We did not verify the technical protocol details of the library, and this article does not describe them. The practical point is simpler: a QR-login service asks you to scan a code, much like linking another device, and from then on the provider's server acts as your WhatsApp.
Official route versus QR-login route
The official route is the WhatsApp Business Platform, whose messaging interface is the Cloud API. Meta's documentation describes it as an interface that "enables you to programmatically message and call on WhatsApp". It needs a business portfolio, a WhatsApp account and Messaging account, a business phone number and access tokens. The table compares the two routes on the points buyers usually ask about.
| Point | Official Cloud API | QR-login service |
|---|---|---|
| Who built it | Meta | A library or vendor, not Meta |
| How you connect | Business portfolio, phone number, access tokens | Scan a QR code |
| Messages outside a 24-hour service window | Approved templates only | Whatever the provider allows (not governed by Meta's template rules) |
| Opt-in | Required before sending templates | Up to you, but WhatsApp's policies still expect it |
| Cost model | Per delivered message, set by Meta | Usually a flat monthly fee from the vendor |
| Support and stability | Documented platform | Depends on the vendor; can break when WhatsApp changes |
| Policy standing | Approved route | Outside WhatsApp's terms as written |
For related background, see open-source WhatsApp CRM options and WhatsApp SIM binding in India.
The honest pros
Unofficial services are popular for reasons that are easy to understand, and a fair assessment should say so.
- Low price. There is no per-message fee from Meta, so a flat monthly price can look far cheaper than the official route.
- Fast start. There is no business portfolio verification or template review to wait for.
- Works with a number you already use. You keep talking to customers from the same number in the same app.
- Free-form messages. You are not limited to pre-approved templates outside the service window.
These are real advantages for a small test. The question is whether they are worth what you give up, which the next section covers.
The risks
Terms of Service and account bans
WhatsApp's Terms of Service say you must not "directly, indirectly, through automated or other means, access, use" the service in the ways the acceptable-use section lists, including creating accounts "through unauthorized or automated means". The terms do not name unofficial libraries, so we cannot say that any single tool is explicitly named; but the same terms say WhatsApp "may take action with respect to your account, including disabling or suspending your account".
WhatsApp's own help page on bans states: "Our products are not intended for bulk or automated messaging." It also says it bans accounts "based on machine-learning classifiers" and has "found and stopped millions of abusive accounts". No vendor outside WhatsApp can guarantee that your number will not be caught. If the number is the one your customers know, a ban means losing that channel and its chat history until WhatsApp restores it, if it does.
Your provider holds a live session to all your chats
When you scan a QR code for a hosted service, the provider's server holds the session. In practice that means the provider can read incoming messages, send messages as you, and see contact names and media. That is a much deeper level of access than an official provider usually has to a template-only integration. Ask where session data is stored, who at the provider can open it, and what happens to it when you cancel.
No service commitment
There is no Meta-backed service level for an unofficial route. If WhatsApp changes how it works, the library or the vendor has to catch up, and your messaging may stop in the meantime. Ask any vendor for its status page history and its written support terms before you rely on it for orders, appointment reminders or payment follow-ups.
Data protection exposure in India
Customer chats contain personal data. Under India's Digital Personal Data Protection Act 2023, a business that decides why and how personal data is processed is generally the responsible party, even when a vendor does the processing for it. We could not open the Act's full text in this run, so we do not quote section numbers or penalty amounts here; read the Act on the Government of India's official sites or ask a lawyer before you decide. Plan to answer these questions: where do the chats live, who can read them, and can you delete them on request?
Reputation
Messages sent without a customer's clear opt-in annoy people and get reported. WhatsApp's Business Messaging Policy says to "not confuse, deceive, defraud, mislead, spam, or surprise people with your communications" and that you need "opt-in permission from the recipient". Those expectations are a good guide to customer-friendly practice even if you never touch the official platform.
How the official route compares in practice
The official route has friction, and it is fair to list it.
- Templates and opt-in. Outside an open 24-hour customer service window you can only send approved templates, and you need the user's opt-in. The opt-in must state your business name and intent.
- Limits. Meta's Cloud API overview describes portfolio-level messaging limits for unique users outside the window and a pair rate limit of about one message per 6 seconds to the same user, with default throughput up to 80 messages per second.
- Cost. Meta's pricing page states that it moved to per-message pricing on July 1, 2025, charging when a message is delivered, with rates varying by message category and the recipient's country calling code. It lists template categories (marketing, utility, authentication) and non-template service messages inside the service window. Per its page, each business phone number gets 1,000 free service messages a month, with charges for service messages starting at the 1,001st from October 1, 2026, and eligible government and non-profit organizations exempt through December 31, 2027. We do not quote rates here; open the pricing page for your market.
How to evaluate a "WhatsApp API" offer
Before paying anyone, ask these questions and write down the answers.
- Is the service built on Meta's WhatsApp Business Platform, or do I scan a QR code to connect my number?
- If it is a QR scan, who holds the session, and where is it stored?
- What does the contract say if my number is banned? Is there any remedy?
- Can I export my contacts and chat history, and what happens on cancellation?
- Does the vendor require customer opt-in and say so in writing?
- Is there a support contact, a status page and a written uptime statement?
- What does my total cost look like against the official route's per-message pricing for my real volume?
If the vendor will not answer questions 1 to 3 clearly, treat that as your answer.
When might an unofficial route be acceptable
Only when losing the number would not hurt. An example is a personal experiment on a spare number that no customer depends on, with messages only to people who asked to hear from you. Even then, remember the terms above. Do not use a number you rely on for sales, support, payments or notifications.
Decision checklist
- The number is business-critical: use the official Cloud API.
- You need template-free chat at scale: this is exactly what WhatsApp says its products are not intended for; rethink the use case.
- Customer data in India is involved: check who processes it and what the contract says before anything else.
- You only want to test an idea: use a spare number and a few opted-in contacts, and expect it may stop working.
What we checked
- Opened the Baileys repository README on 2026-11-30: confirmed the "not affiliated, associated, authorized, endorsed by, or in any way officially connected with WhatsApp" disclaimer, the MIT license, and the "Do not spam people with this" line. The page we read did not describe login or mention account bans.
- Opened WhatsApp's Terms of Service on 2026-11-30 and read the acceptable-use clauses on automated or unauthorized access and the account suspension wording quoted above. The terms do not name unofficial clients.
- Opened WhatsApp's help page on bans (FAQ 5957850900902049) on 2026-11-30: documented lines include "Our products are not intended for bulk or automated messaging."
- Opened Meta's Cloud API overview and pricing page on 2026-11-30 and cross-checked the 24-hour window and template rules between the overview and the Business Messaging Policy at whatsappbusiness.com/policy.
- Cross-checked the opt-in requirement: the Cloud API overview and the Business Messaging Policy both require it.
- Not checked: we could not open the DPDP Act text (the government PDFs returned access errors), so no section numbers are quoted; we did not install or run Baileys or any QR-login service; we did not open WhatsApp's help article on unofficial apps (the URLs we tried returned not found).
Last tested: 2026-11-30
References
- Baileys repository: https://github.com/WhiskeySockets/Baileys
- WhatsApp Terms of Service: https://www.whatsapp.com/legal/terms-of-service
- WhatsApp help, account bans: https://faq.whatsapp.com/5957850900902049
- WhatsApp Business Messaging Policy: https://whatsappbusiness.com/policy/
- WhatsApp Business Platform Cloud API overview: https://developers.facebook.com/docs/whatsapp/cloud-api/overview
- WhatsApp Business Platform pricing: https://developers.facebook.com/docs/whatsapp/pricing
This guide was researched and drafted with AI assistance and checked against the vendor documentation listed in its References. Read the maintained version and related guides on EpiFive.
來源:DEV Community · dev.to