1.0.5 • Published 5 months ago

whatsapp-profile v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
5 months ago

WhatsApp Profile Library

A simple JavaScript library to retrieve public profile information from WhatsApp Business accounts. Please note that this library is designed to work only with business profiles, as personal user data is protected by privacy measures within the WhatsApp application.

Installation

To install the library, use the following npm command:

npm install whatsapp-profile

Usage

import { getProfileDataFromWhatsapp } from 'whatsapp-profile';

(async () => {
    // Example 1
    let profile = await getProfileDataFromWhatsapp('554484420807');
    console.log(profile);

    // Output:
    // {
    //     name: 'Caramelo Burger e Fries',
    //     number: '554484420807',
    //     profileURL: 'https://pps.whatsapp.net/v/t61.24694-24/244700026_397263505444451_3215879762500628174_n.jpg?ccb=11-4&oh=01_AdSfzo49B7NQSt_rfYyjlVC5p8MpuTu25LwT5fUvVJFVZg&oe=6569DF0E&_nc_sid=e6ed6c&_nc_cat=100'
    // }

    // Example 2
    profile = await getProfileDataFromWhatsapp('5544998989898');
    console.log(profile);

    // Output:
    // { name: '', number: '5544998989898', profileURL: null }
})();

API Reference

getProfileDataFromWhatsapp(phoneNumber: string): Promise<ProfileData>

Retrieves public profile data from WhatsApp Business accounts.

  • phoneNumber: The complete phone number (including country code) for the target WhatsApp Business account.

Returns:

  • ProfileData: An object containing profile information.
    • profileURL: URL for the profile picture (null if not available).
    • name: Name displayed on the WhatsApp Business account.
    • number: The provided phone number.

Example

import { getProfileDataFromWhatsapp } from 'whatsapp-profile';

(async () => {
    let profile = await getProfileDataFromWhatsapp('554484420807');
    console.log(profile);

    // Output:
    // {
    //     name: 'Caramelo Burger e Fries',
    //     number: '554484420807',
    //     profileURL: 'https://pps.whatsapp.net/v/t61.24694-24/244700026_397263505444451_3215879762500628174_n.jpg?ccb=11-4&oh=01_AdSfzo49b7NQSt_rfYyjlVC5p8MpuTu25LwT5fUvVJFVZg&oe=6569DF0E&_nc_sid=e6ed6c&_nc_cat=100'
    // }
})();

Notes

  • This library is intended for educational purposes and should only be used in compliance with WhatsApp's terms of service.
  • Personal user data is protected by WhatsApp's privacy measures and cannot be accessed through this library.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.


Feel free to contribute to the project or report issues on GitHub.

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago