The InstaPage module

class InstaTweet.instapage.InstaPage(data, client=None)[source]View on GitHub

Bases: ABC

Abstract wrapper class for wrapping API responses from Instagram pages

__init__(data, client=None)[source]View on GitHub

Initialize an InstaPage

Used to wrap responses from endpoints that contain Instagram post data, like Instagram user profiles and Instagram hashtag searches

Parameters
abstract property name: str

Name of the Instagram page

abstract property page_data: Dict

Data about the Instagram page itself

abstract property media_data: Dict

Data about posts on the Instagram page

property id: int

ID of the Instagram page

property posts: List[InstaPost]

Posts that have been scraped from the Instagram page

To retrieve the next page of posts, call get_more_posts()

Returns

the page’s posts as InstaPost objects

Requests the next page of posts from the InstaPage

If the page has_more_posts, they’ll be added to the posts list

Returns

True if the request was successful, otherwise False

Return type

bool

Returns True if more posts can be scraped using get_more_posts()

property end_cursor: str

Cursor used in request by get_more_posts()

property media_page_info: Dict
class InstaTweet.instapage.InstaUser(data, client=None)[source]View on GitHub

Bases: InstaPage

API response wrapper for an Instagram user’s profile

__init__(data, client=None)[source]View on GitHub

Initialize an InstaUser

Parameters
property name: str

Name of the Instagram page

property page_data: Dict

Data about the Instagram page itself

property media_data: Dict

Data about posts on the Instagram page

class InstaTweet.instapage.Hashtag(data, client=None)[source]View on GitHub

Bases: InstaPage

API response wrapper for an Instagram hashtag

__init__(data, client=None)[source]View on GitHub

Initialize a Hashtag

Parameters
property name: str

Name of the Instagram page

property page_data: Dict

Data about the Instagram page itself

property media_data: Dict

Data about posts on the Instagram page

property top_posts: List[InstaPost]
property top_media_data: Dict