Python Library for Interacting with Meta Platforms Api: Threads, Facebook, and Instagram
Project description
MetaPlapi
Python Library for Interacting with Meta Platforms Api: Threads, Facebook, and Instagram
MetaPlapi is a powerful and flexible Python library designed to interact with Meta's social media platforms api, including Threads, Facebook, and Instagram. It provides tools for automating tasks, managing accounts, scraping data, and customizing device configurations to avoid suspicious activity. Built with developers in mind, metaplapi offers full control over account management, media post scraping, and more.
Requirements
| Library | Installation |
|---|---|
| Requests | pip install requests |
| Pycryptodomex | pip install pycryptodomex |
Table of Contents
Installation
install with pip
pip install metaplapi
install with clone repository
git clone https://github.com/iqbalmh18/metaplapi
cd metaplapi
pip install .
Quick Start
example usage of metaplapi for threads
from metaplapi import Threads
# set new threads session
tr = Threads(cookie='YOUR THREADS COOKIE')
# get account info
print(tr.account())
# get username info
print(tr.username('username')
# get followers from target username
foll = tr.followers('username')
for user in foll:
print(user)
# get following from target username
foll = tr.following('username')
for user in foll:
print(user)
example usage of metaplapi for facebook
from metaplapi import Facebook
# set new facebook session
fb = Facebook(cookie='YOUR THREADS COOKIE')
# get account info
print(fb.account())
# get friends from target id
frnd = fb.friends('facebook_id')
for user in frnd:
print(user)
# get followers from target id
foll = fb.followers('facebook_id')
for user in foll:
print(user)
# get following from target id
foll = fb.following('facebook_id')
for user in foll:
print(user)
example usage of metaplapi for instagram
from metaplapi import Instagram
# set new instagram session
ig = Instagram(cookie='YOUR INSTAGRAM COOKIE')
# get account info
print(ig.account())
# get username info
print(ig.username('username')
# get location info from username
print(ig.location('username')
# get followers from target username
foll = ig.followers('username')
for user in foll:
print(user)
# get following from target username
foll = ig.following('username')
for user in foll:
print(user)
# get mediapost from target username
media = ig.mediapost('username')
for post in media:
print(post)
# get media info from media id or url
url = 'https://www.instagram.com/p/XXXX'
print(ig.media_info(url))
Customize
Check Available Device
from metaplapi import DEVICE, DEVICE_LIST
print(DEVICE)
print(DEVICE_LIST)
Check Available Country
from metaplapi import COUNTRY, COUNTRY_LIST
print(COUNTRY)
print(COUNTRY_LIST)
Device Customization
from metaplapi import Device
device = Device(device_brand='Samsung', device_model='SM-A125F', device_country='ID')
info = device.info()
print(info)
User Agent Customization
from metaplapi import Device, UserAgent
device = Device(device_brand='Samsung', device_model='SM-A125F', device_country='ID')
useragent = UserAgent(device)
print(useragent.dalvik())
print(useragent.threads())
print(useragent.facebook())
print(useragent.instagram())
Advance
example usage of metaplapi for advance users
from metaplapi import (
Device,
UserAgent,
Generator,
Instagram
)
cookies = 'YOUR INSTAGRAM COOKIE'
proxies = {'http': 'protocol:ip:port', 'https': 'protocol:ip:port'}
devices = Device('Samsung').info()
useragent = UserAgent(devices)
generator = Generator()
device_id = generator.device_id()
ig = Instagram(cookie=cookies, device=devices, device_id=device_id, proxies=proxies)
info = ig.account()
if info:
print(info)
print(ig.session.headers)
else:
print('cookie is not valid or have been expired')
example usage to generate identifier for advance users
from metaplapi import Identifier
identify = Identifier(firstname='john', last_name='doe', domain=['gmail.com','yahoo.com'], result=10)
emails = identify.email()
for email in emails:
print(email)
usernames = identify.username()
for username in usernames:
print(username)
fullname = identify.fullname()
print(fullname)
wordlist = identify.wordlist()
print(wordlist)
Authors
Iqbalmh18
Follow on Instagram
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file metaplapi-0.0.2.tar.gz.
File metadata
- Download URL: metaplapi-0.0.2.tar.gz
- Upload date:
- Size: 29.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cdaf3bec69b7fb5b3dfa6964cd1d3f4a27e7743f6cd18f41e07dfa0eb09ae20
|
|
| MD5 |
79061dc0f2ab9adeebc9a8f3f4471ba4
|
|
| BLAKE2b-256 |
335b151d502bf3307efdc48b5d09769ca2765272da66e0dca2130c8388419be1
|
File details
Details for the file metaplapi-0.0.2-py3-none-any.whl.
File metadata
- Download URL: metaplapi-0.0.2-py3-none-any.whl
- Upload date:
- Size: 29.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2829276e169b94d71307972d688a1a10983838576f56020db9bccba0adba215
|
|
| MD5 |
60eebb084651a4411d54dbe483ee244a
|
|
| BLAKE2b-256 |
b56c06cf1573e51c79609f1f0f6353623fa7c76b8b64e7e2f02da0882dcf81ab
|