aiograpi - Asynchronous Instagram API for Python If you want to work with aiograpi…
- User
aiograpi - Asynchronous Instagram API for Python If you want to work with aiograpi (business interests), we strongly advise you to prefer HikerAPI project. However, you won't need to spend weeks or even months setting it up. The best service available today is HikerAPI, which handles 4–5 million daily requests, provides support around-the-clock, and offers partners a special rate. In many instances, our clients tried to save money and preferred aiograpi, but in our experience, they ultimately returned to HikerAPI after spending much more time and money. It will be difficult to find good accounts, good proxies, or resolve challenges, and IG will ban your accounts.
The aiograpi more suits for testing or research than a working business!
We recommend using our services: LamaTok for TikTok API 🔥 HikerAPI for Instagram API ⚡⚡⚡ DataLikers for Instagram Datasets 🚀 Package PyPI PyPI - Python Version Checked with mypy
Features:
Getting public data of user, posts, stories, highlights, followers and following users Getting public email and phone number, if the user specified them in his business profile Getting public data of post, story, album, Reels, IGTV data and the ability to download content Getting public data of hashtag and location data, as well as a list of posts for them Getting public data of all comments on a post and a list of users who liked it Management of proxy servers, mobile devices and challenge resolver Login by username and password, sessionid and support 2FA Managing messages and threads for Direct and attach files Download and upload a Photo, Video, IGTV, Reels, Albums and Stories Work with Users, Posts, Comments, Insights, Collections, Location and Hashtag Insights by account, posts and stories Like, following, commenting, editing account (Bio) and much more else Asynchronous Instagram Private API wrapper without selenium. Use the most recent version of the API from Instagram, which was obtained using reverse-engineering with Charles Proxy and Proxyman.
Instagram API valid for 27 Feb 2024 (last reverse-engineering check)
Support Python >= 3.10
For any other languages (e.g. C++, C#, F#, D, Golang, Erlang, Elixir, Nim, Haskell, Lisp, Closure, Julia, R, Java, Kotlin, Scala, OCaml, JavaScript, Crystal, Ruby, Rust, Swift, Objective-C, Visual Basic, .NET, Pascal, Perl, Lua, PHP and others), I suggest using instagrapi-rest
Support Chat in Telegram and GitHub Discussions
Features Performs Web API or Mobile API requests depending on the situation (to avoid Instagram limits) Login by username and password, including 2FA and by sessionid (and uses Authorization header instead Cookies) Challenge Resolver have Email and SMS handlers Support upload a Photo, Video, IGTV, Reels, Albums and Stories Support work with User, Media, Comment, Insights, Collections, Location (Place), Hashtag and Direct Message objects Like, Follow, Edit account (Bio) and much more else Insights by account, posts and stories Build stories with custom background, font animation, link sticker and mention users Account registration and captcha passing will appear Installation pip install aiograpi Basic Usage from aiograpi import Client
- Assistant
- User
بالعربية من فضلك
- Assistant
- User
حسن في الشيفرة باحترافية مع اضافة التدابير الامنية من الحظر مع تحسين الفعالية وتسهيل الاستخدام واضافة محال لادخال مجال المراد او النيتش
- Assistant
- User
- Assistant
حسناً، بناءً على المعلومات التي قدمتها، سأساعدك في كتابة شيفرة لاستخدام مكتبة
instagrapiللتمكن من التفاعل مع حساب إنستغرام. سأقدم لك مثالاً بسيطًا لكيفية استخدام المكتبة للحصول على معلومات مستخدم معينة وإظهار كيفية التفاعل معها.الإعداد الأساسي لاستخدام
instagrapi-
تثبيت المكتبة:
تأكد من أن لديك Python مثبتًا على جهازك، ويفضل أن يكون الإصدار 3.9 أو أعلى. ثم استخدم الأمر التالي لتثبيت المكتبة:
pip install instagrapi -
البدء باستخدام المكتبة:
إليك شيفرة بسيطة لتسجيل الدخول والحصول على آخر المنشورات من حساب معين:
from instagrapi import Client # تهيئة العميل وتسجيل الدخول cl = Client() cl.login("YOUR_USERNAME", "YOUR_PASSWORD") # الحصول على معرف المستخدم بناءً على اسم المستخدم user_id = cl.user_id_from_username("TARGET_USERNAME") # جلب آخر 20 منشوراً للمستخدم medias = cl.user_medias(user_id, 20) # طباعة تفاصيل المنشورات for media in medias: print(f"Media ID: {media.id}") print(f"Caption: {media.caption_text}\n")
-
- User
هل تستطيع هذه المكتبه ان تستخرج لي احدث المنشورات في مجال معين والاكثر تفاعلا
- Assistant
نعم، يمكن لمكتبة
instagrapiمساعدتك في استخراج أحدث المنشورات في مجال معين (نيتش) باستخدام الهاشتاجات، ويمكنك أيضاً فرز هذه المنشورات بناءً على التفاعل (الإعجابات، التعليقات، وما إلى ذلك). إليك كيفية القيام بذلك:استخدام الهاشتاج لجلب المنشورات
يمكنك البحث عن المنشورات باستخدام الهاشتاج المرتبط بالمجال الذي تهتم به. إليك مثال بسيط يوضح كيفية جلب أحدث المنشورات المتعلقة بهاشتاج معين:
from instagrapi import Client import asyncio # وظيفة لاختيار المنشور الأكثر تفاعلاً def most_engaged(medias, top_n): # فرز المنشورات بناءً على عدد الإعجابات والتعليقات sorted_medias = sorted(medias, key=lambda m: (m.like_count + m.comment_count), reverse=True) return sorted_medias[:top_n] # الوظيفة الأساسية def main(niche): # تهيئة العميل وتسجيل الدخول cl = Client() cl.login("YOUR_USERNAME", "YOUR_PASSWORD") # جلب معلومات الهاشتاج hashtag_info = cl.hashtag_info(niche) # جلب أحدث المنشورات (مثال: 50 منشوراً) medias = cl.hashtag_medias(hashtag_info.id, amount=50) # جلب أعلى 10 منشورات تفاعلاً top_medias = most_engaged(medias, 10) # طباعة تفاصيل المنشورات الأكثر تفاعلاً for media in top_medias: print(f"Media ID: {media.id} - Likes: {media.like_count} - Comments: {media.comment_count}") print(f"Caption: {media.caption_text}\n") if __name__ == "__main__": niche = input("أدخل الهاشتاج المطلوب بدون الرمز #: ").strip() main(niche) - User
اذا اكتب لي شفره احترافيه كامله تستخرج احدث المنشورات في مجال معين قبل يوم مثلا مع تسهيل استخدام شفره من ناحيه اسلوب الادخال مثل اسم المستخدم او البريد كذلك اسلام الادخال على الهاشتاج كذلك اسلوب الادخال على عدد المنشورات المستخرجه
- Assistant
- User
أدخل اسم المستخدم أو البريد الإلكتروني: ey_e.fun أدخل كلمة المرور: drea1991 أدخل الهاشتاج بدون #: art أدخل عدد المنشورات المطلوبة: 5
[Program finished] !؟؟
- Assistant
إذا واجهت خطأ أو أن البرنامج توقف عن العمل دون إرجاع المعلومات المطلوبة، من المهم التحقق من عدة نقاط لضمان أن كل شيء يعمل بشكل صحيح.
خطوات للتحقق من المشاكل وحلها:
-
التحقق من بيانات تسجيل الدخول:
- تأكد من أن اسم المستخدم أو البريد الإلكتروني وكلمة المرور صحيحة. إذا كان هناك خطأ في بيانات تسجيل الدخول، فلن تتمكن من الاتصال بخوادم إنستغرام بشكل صحيح.
- قد تحتاج إلى التعامل مع التحقق الثنائي (2FA) إذا كان مفعلًا لحسابك. مكتبة
instagrapiتدعم ذلك وقد تحتاج لضبط الإعدادات لتلائم احتياجات التحقق.
-
التأكد من إصدار المكتبة:
- تأكد من أنك تستخدم أحدث إصدار من مكتبة
instagrapiلأنها تتعامل مع التغييرات في إنستغرام بشكل متكرر. يمكنك تحديث المكتبة باستخدام:
- تأكد من أنك تستخدم أحدث إصدار من مكتبة
-