Facebook-Unofficial-API

Facebook Unofficial API

Available Languages: 🇺🇸 🇹🇷

Facebook is one of the world’s most popular social media platforms with billions of users.

For businesses, brands and individuals, Facebook offers opportunities to reach large audiences, increase brand awareness and engage with target audiences. However, driving and managing these interactions can sometimes be complex.

This is where the new Unofficial Facebook API we developed with TypeScript comes in.

This library makes it easier to manage your interactions on Facebook and allows businesses or developers to operate more effectively on the Facebook platform.

Introduction to Facebook Library

This library is written in TypeScript for Node.JS and allows you to perform various operations using the Facebook API. Here are some of the features this library provides:

This library allows you to effectively operate on the Facebook platform using the power of Node.js. It is also easy to use and reduces the complexity required to manage Facebook Unofficial API calls.

Getting Started

To start the development process, make sure you have Node.js installed on your system. You can download it from the official Node.js website or use a package manager like npm (Node Package Manager) to install it.

Installation

$ npm i facebook-unofficial-api
$ bun i facebook-unofficial-api
$ pnpm i facebook-unofficial-api

How to import

const { Facebook } = require('facebook-unofficial-api');

Login with Facebook

async function loginRequest() {
 const facebookInstance = new Facebook();
 const Username = 'Your Facebook Mail or Username';
 const Password = 'Your Facebook Password';

// If you want to use a proxy -> facebookInstance.fProxy = 'http://proxy_username:proxy_password@proxy_ip:proxy_port'

facebookInstance.loginRequest(Username, Password).then((response) => {
console.log(response);
}).catch((err) => {
console.log(err);
});
} loginRequest()

Pull User Information

async function checkUserDetails(){
const UUID = 'Facebook UUID -> You can get it from the login process';
const Token = 'Facebook Token -> You can get it from the login process';

// If you want to use a proxy -> facebookInstance.fProxy = 'http://proxy_username:proxy_password@proxy_ip:proxy_port'

facebookInstance.checkUserDetails(UUID,Token).then((response) => {
console.log(response);
}).catch((err) => {
console.log(err);
})
}checkUserDetails()

Post & Page Like

const Token = 'Facebook Token -> You can get it from the login process';
const postID = 'pfbid027yBu3CAGH1f1mUPom2peRFdDpfWWZJaQy5obBojJobc4dYhuyY144maebMVnRCsBl';

// If you want to use a proxy -> facebookInstance.fProxy = 'http://proxy_username:proxy_password@proxy_ip:proxy_port'

facebookInstance.sendLike(postID, Token).then((response) => {
console.log(response);
}).catch((err) => {
console.log(err);
});

Send Comment

const Token = 'Facebook Token -> You can get it from the login process';
const postID = 'pfbid027yBu3CAGH1f1mUPom2peRFdDpfWWZJaQy5obBojJobc4dYhuyY144maebMVnRCsBl';
const Message = 'Comment';

// If you want to use a proxy -> facebookInstance.fProxy = 'http://proxy_username:proxy_password@proxy_ip:proxy_port'

facebookInstance.sendComment(postID, Token, Message).then((result) => {
console.log(result);
}).catch((err) => {
console.log(err);
});

Keywords

Facebook, Facebook API, Facebook Unofficial API, Unofficial Facebook API, NodeJS Developer, Back-end Developer, Node.JS Developer, Backend Developer

Github Patreon BuyMeaCoffee
Copyright: [email protected] Other Issues: [email protected]

Social Media

Linkedin Twitter Bluesky Instagram Youtube Telegram Github Npmjs

License

Can Yesilyurt cy4udev