Kiểm tra username Instagram có tồn tại không bằng Python

Bài code này sử dụng thư viện requests và BeautifulSoup để:

Gửi request tới trang profile Instagram (ví dụ: https://www.instagram.com/username/) để lấy cookie và CSRF token.
Dùng API https://www.instagram.com/api/v1/users/web_profile_info/ với header tối giản để kiểm tra username.
Kết quả trả về thông tin cơ bản (username, full name, ID, trạng thái private) nếu profile tồn tại, hoặc thông báo không tìm thấy nếu username không hợp lệ.



Code gọn nhẹ, dễ tùy chỉnh, hỗ trợ xử lý lỗi cơ bản.

Comment Facebook