☎️ Client#

This page is about the client methods.

  • All the methods here are bound to to a Me instance.

from meapi import Me

me = Me(972123456789) # initialize the client
me.phone_search(972987654321)
me.get_profile('fdsfs-fdsfs-fdsfs-fdsfs')
me.get_socials()
me.get_settings()
me.get_groups()

😎 Profile#

Me.get_profile(uuid: Union[str, Contact, User]) Profile#

Get user’s profile.

For Me users (those who have registered in the app) there is an account UUID obtained when receiving information about the phone number phone_search(). With it, you can get social information and perform social actions.

>>> p = me.get_profile(uuid='f7930d0f-c8ba-425b-8478-013968f30466')
>>> print(p.name, p.email, p.profile_picture, p.gender, p.date_of_birth, p.slogan)
Parameters:

uuid (str | Contact | User) – The user’s UUID as str or Contact or User objects.

Raises:

ProfileViewPassedLimit – if you passed the limit (About 500 per day in the unofficial auth method).

Returns:

Profile object.

Return type:

Profile

Me.get_my_profile(only_limited_data: bool = False) Profile#

Get your profile information.

>>> p = me.get_my_profile()
>>> p.as_dict()
>>> p.as_vcard()
>>> p.name = 'Changed Name'
>>> p.email = 'john.doe@gmail.com'
Parameters:

only_limited_data (bool) – True to get only limited data (not included in the rate limit). Default: False.

Returns:

Profile object.

Return type:

Profile

Me.update_profile_details(first_name: Optional[str] = False, last_name: Optional[str] = False, email: Optional[str] = False, gender: Optional[str] = False, slogan: Optional[str] = False, profile_picture: Optional[str] = False, date_of_birth: Optional[Union[str, datetime, date]] = False, location_name: Optional[str] = False, carrier: Optional[str] = False, device_type: Optional[str] = False, login_type: Optional[str] = False, facebook_url: Optional[Union[str, int]] = False, google_url: Optional[Union[str, int]] = False) Tuple[bool, Profile]#
Update your profile details.
  • The default of the parameters is False. if you leave it False, the parameter will not be updated.

Examples

>>> is_success, new_profile = me.update_profile_details(first_name='Chandler', last_name='Bing', date_of_birth='1968-04-08')
>>> new_details = {'location_name': 'New York', 'gender': 'M'}
>>> me.update_profile_details(**new_details)  # dict unpacking
(True, Profile(name='Chandler Bing', date_of_birth=datetime.date(1968, 4, 8), location_name='New York', gender='M', ...))
Parameters:
  • first_name (str | None) – First name.

  • last_name (str | None) – Last name.

  • email (str | None) – For example: user@domian.com.

  • gender (str | None) – M for male, F for female.

  • profile_picture (str | None) – Direct image url or local image path. for example: https://example.com/image.png, /home/david/Downloads/my_profile.jpg.

  • slogan (str | None) – Your bio.

  • date_of_birth (str | date | datetime | None) – date/datetime obj or string with YYYY-MM-DD format. for example: 1994-09-22.

  • location_name (str | None) – Your location, can be anything.

  • login_type (str | None) – email or apple.

  • device_type (str | None) – android or ios.

  • carrier – The carrier of your phone. like HOT-mobile, AT&T etc.

  • facebook_url (str | int | None) – facebook id, for example: 24898745174639.

  • google_url (str | int | None) – google id, for example: 24898745174639.

Returns:

Tuple of: Is update success, new Profile object.

Return type:

Tuple[bool, Profile]

Raises:
  • ValueError – If one of the parameters is not valid.

  • BlockedAccount – If your account is blocked for updating profile details.

🌐 Social#

Me.get_socials(uuid: Union[str, Profile, User, Contact] = None) Social#

Get connected social networks to Me account.

>>> me.get_socials() # get your socials
>>> me.get_socials(uuid='f7930d0f-c8ba-425b-8478-013968f30466') # get socials of other user
Parameters:

uuid (str | Profile | User | Contact) – uuid of the user or Profile, User, or Contact objects. Default: Your uuid.

Returns:

Social object with social media accounts.

Return type:

Social

Raises:

ContactHasNoUser – If the contact has no user.

Me.add_social(twitter_token: str = None, spotify_token: str = None, instagram_token: str = None, facebook_token: str = None, tiktok_token: str = None, pinterest_url: str = None, linkedin_url: str = None) bool#
Connect social network to your me account.
  • As of this moment, it is not possible to connect to networks that require a token (all except LinkedIn and Pinterest) because the login url is generted every time. This operation is only possible through the official app.

  • If you have at least 2 socials, you get is_verified=True in your profile (Blue check).

  • The connected socials will be shown in your profile unless you hide them with switch_social_status().

>>> me.add_social(pinterest_url='https://www.pinterest.com/username/')
>>> me.add_social(linkedin_url='https://www.linkedin.com/in/username')
>>> me.get_my_profile().is_verified
True
Parameters:
  • twitter_token (str) – Twitter Token. Default = None.

  • spotify_token (str) – Default = None.

  • instagram_token (str) – Default = None.

  • facebook_token (str) – Default = None.

  • tiktok_token (str) – Default = None.

  • pinterest_url (str) – Profile url - https://www.pinterest.com/username/. Default = None.

  • linkedin_url (str) – Profile url - https://www.linkedin.com/in/username. Default = None.

Returns:

Is connected successfully.

Return type:

bool

Raises:
  • TypeError – If you don’t provide any social.

  • ValueError – If you provide an invalid url.

Me.remove_social(twitter: bool = False, spotify: bool = False, instagram: bool = False, facebook: bool = False, pinterest: bool = False, linkedin: bool = False, tiktok: bool = False) bool#
Remove social networks from your profile.
>>> me.remove_social(pinterest=True, linkedin=True)
Parameters:
  • twitter (bool) – To remove Twitter. Default: False.

  • spotify (bool) – To remove Spotify. Default: False.

  • instagram (bool) – To remove Instagram. Default: False.

  • facebook (bool) – To remove Facebook. Default: False.

  • pinterest (bool) – To remove Pinterest. Default: False.

  • linkedin (bool) – To remove Linkedin. Default: False.

  • tiktok (bool) – To remove Tiktok. Default: False.

Returns:

Is removal success.

Return type:

bool

Raises:

TypeError – If you don’t provide any social.

Me.switch_social_status(twitter: bool = None, spotify: bool = None, instagram: bool = None, facebook: bool = None, tiktok: bool = None, pinterest: bool = None, linkedin: bool = None) bool#
Switch social network status: Show (True) or Hide (False).
>>> me.switch_social_status(pinterest=False, linkedin=False)
>>> me.get_socials().linkedin.is_hidden
True
Parameters:
  • twitter (bool) – Switch Twitter status. Default: None.

  • spotify (bool) – Switch Spotify status Default: None.

  • instagram (bool) – Switch Instagram status Default: None.

  • facebook (bool) – Switch Facebook status Default: None.

  • tiktok (bool) – Switch TikTok status Default: None.

  • pinterest (bool) – Switch Pinterest status Default: None.

  • linkedin (bool) – Switch Linkedin status Default: None.

Returns:

is switch success (you get True even if social active or was un/hidden before).

Return type:

bool

Raises:

TypeError – If you don’t provide any social.

Me.friendship(phone_number: Union[int, str]) Friendship#

Get friendship information between you and another number. like count mutual friends, total calls duration, how do you name each other, calls count, your watches, comments, and more.

>>> me.friendship(972544444444)
Friendship(calls_duaration=0, he_named='Chandler Bing', i_named='Monica Geller'...)
Parameters:

phone_number (int | str) – International phone number format.

Returns:

Friendship object.

Return type:

Friendship

Me.who_deleted(incognito: bool = False, sorted_by: Optional[str] = 'created_at') List[Deleter]#

Get list of users who deleted you from their contacts.

The who_deleted_enabled setting must be True in your settings account in order to see who deleted you. See change_settings(). You can use incognito=True to automatically enable and disable before and after (Required two more API calls).

>>> me.who_deleted(incognito=True)
[Deleter(created_at=datetime.datetime(2020, 1, 1, 0, 0), user=User(uuid='...', name='...', ...))]
Parameters:
  • incognito (bool) – If True, this automatically enables and disables who_deleted_enabled. Default: False.

  • sorted_by (str) – Sort by created_at or None. Default: created_at.

Returns:

List of Deleter objects sorted by their creation time.

Return type:

List[Deleter]

Raises:

ValueError – If sorted_by is not created_at or None.

Me.who_watched(incognito: bool = False, sorted_by: str = 'count') List[Watcher]#

Get list of users who watched your profile.

The who_watched_enabled setting must be True in your settings account in order to see who watched your profile. See change_settings(). You can use incognito=True to automatically enable and disable before and after (Required two more API calls).

>>> me.who_watched(incognito=True)
[Watcher(count=1, last_view=datetime.datetime(2020, 1, 1, 0, 0), user=User(uuid='...', name='...', ...))]
Parameters:
  • incognito (bool) – If True, this automatically enables and disables who_watched_enabled. Default: False.

  • sorted_by (str) – Sort by count or last_view. Default: count.

Returns:

List of Watcher objects sorted by watch count (By default) or by last view.

Return type:

List[Watcher]

Raises:

ValueError – If sorted_by is not count or last_view.

Me.suggest_turn_on_mutual(uuid: Union[str, Profile, User, Contact]) bool#

Ask another user to turn on mutual contacts on his profile.

>>> me.suggest_turn_on_mutual('d4c7b2c0-5b5a-4b4b-9c1c-8c7b6a5b4c3d')
Parameters:

uuid (str | Profile | User | Contact) – uuid, Profile, User, or Contact of the user.

Returns:

Is request success.

Return type:

bool

Raises:

ContactHasNoUser – If you provide Contact without user.

Me.report_spam(country_code: str, spam_name: str, phone_number: Union[str, int]) bool#
Report spam on another phone number.
>>> me.report_spam('IL', 'Spammer', 972544444444)
Parameters:
  • country_code (str) – Two letters code, IL, IT, US etc. // Country codes.

  • spam_name (str) – The spam name that you want to give to the spammer.

  • phone_number (int | str) – spammer phone number in international format.

Returns:

Is report success

Return type:

bool

Me.is_spammer(phone_number: Union[int, str]) int#

Check on phone number if reported as spam.

>>> me.is_spammer(989123456789)
Parameters:

phone_number (int | str) – International phone number format.

Returns:

count of spam reports. 0 if None.

Return type:

int

Me.get_age(uuid: Union[str, Profile, User, Contact] = None) int#

Get user age. calculate from date_of_birth, provided by get_profile().

>>> me.get_age()
18
Parameters:

uuid (str | Profile | User | Contact) – uuid of the user or Profile, User, or Contact objects. Default: Your uuid.

Returns:

User age if date of birth exists. else - 0.

Return type:

int

Me.numbers_count() int#

Get total count of numbers on Me.

>>> me.numbers_count()
6421368062
Returns:

total count.

Return type:

int

πŸ‘₯ Group names#

Me.get_groups(sorted_by: str = 'count') List[Group]#
Get groups of names and see how people named you.
>>> me.get_groups(sorted_by='count')
[Group(name='Delivery Service', count=2, contacts=[User(name='David'...), User(name='John'...)]), ...]
Parameters:

sorted_by (str) – Sort by count or last_contact_at. Default: count.

Returns:

List of Group objects.

Return type:

List[Group]

Raises:

ValueError – If sorted_by is not count or last_contact_at.

Me.get_deleted_groups() List[Group]#

Get group names that you deleted.

>>> me.get_deleted_groups()
[Group(name='Delivery Service', count=2, contacts=[User(name='David'...), User(name='John'...)]), ...]
Returns:

List of Group objects sorted by their count.

Return type:

List[Group]

Me.delete_group(contacts_ids: Union[Group, int, str, List[Union[int, str]]]) bool#
Delete group name.
  • You can restore deleted group with restore_name().

  • You can also ask for rename with ask_group_rename().

>>> me.delete_group(contacts_ids=me.get_groups()[0].contact_ids)
Parameters:

contacts_ids (Group | int | str | List[int, str]) – Group object, single or list of contact ids from the same group. See get_groups().

Returns:

Is delete success.

Return type:

bool

Me.restore_group(contacts_ids: Union[int, str, List[Union[int, str]]]) bool#
Restore deleted group from.
>>> me.restore_group(contacts_ids=me.get_deleted_groups()[0].contact_ids)
Parameters:

contacts_ids (Group | int | str | List[int, str]) – Group object, single or list of contact ids from the same group. See get_groups().

Returns:

Is delete success.

Return type:

bool

Me.ask_group_rename(contacts_ids: Union[Group, int, str, List[Union[int, str]]], new_name: Optional[str] = None) bool#

Suggest new name to group of people and ask them to rename you in their contacts book.

>>> group = me.get_groups()[0]
>>> group.name
'Delivery Service'
>>> me.ask_group_rename(contacts_ids=group.contact_ids, new_name='Chandler Bing')
Parameters:
  • contacts_ids (Group | int | str | List[int, str]) – Group object, single or list of contact ids from the same group. See get_groups().

  • new_name (str | None) – Suggested name, Default: Your profile name from get_profile().

Returns:

Is asking success.

Return type:

bool

πŸ’¬ Comments#

Me.get_comments(uuid: Union[str, Profile, User, Contact] = None) List[Comment]#
Get comments in user’s profile.
  • Call the method with no parameters to get comments in your profile.

>>> comments = me.get_comments(uuid='f7930d0f-c8ba-425b-8478-013968f30466')
[Comment(uuid='...', text='...', ...), ...]
Parameters:

uuid (str | User | Profile | Contact) – uuid of the user or Profile, User, or Contact objects. Default: Your uuid.

Returns:

List of Comment objects sorted by their like count.

Return type:

List[Comment]

Raises:
  • ValueError – In the official-auth-method mode you must to provide user uuid if you want to get your comments.

  • ContactHasNoUser – If you provide a contact object without user.

Me.get_comment(comment_id: Union[int, str]) Comment#
Get comment details, comment text, who and how many liked, create time and more.
  • This methods return Comment object with just message, like_count and comment_likes atrrs.

>>> comment = me.get_comment(comment_id=1065393)
Parameters:

comment_id (int | str) – Comment id from get_comments().

Returns:

Comment object.

Return type:

Comment

Me.publish_comment(your_comment: str, uuid: Union[str, Profile, User, Contact] = None, add_credit: bool = False) Optional[Comment]#
Publish comment in user’s profile.
  • You can publish comment on your own profile or on someone else’s profile.

  • When you publish comment on someone else’s profile, the user need to approve your comment before it will be visible.

  • You can edit your comment by simple calling publish_comment() again. The comment status will be changed to waiting until the user approves it.

  • You can ask the user to enable comments in his profile with suggest_turn_on_comments().

  • If the user doesn’t enable comments (comments_enabled), or if he blocked you from comments (comments_blocked), you will get None. You can get this info with get_profile().

>>> comment = me.publish_comment(your_comment='Hello World!', uuid='f7930d0f-c8ba-425b-8478-013968f30466')
Comment(id=123, status='waiting', message='Hello World!', author=User(uuid='...', ...), ...)
Parameters:
  • your_comment (str) – Your comment.

  • uuid (str | Profile | User | Contact) – uuid of the user or Profile, User, or Contact objects. Default: Your uuid.

  • add_credit (bool) – If True, this will add credit to the comment. Default: False.

Returns:

Optional Comment object.

Return type:

Comment | None

Raises:

ContactHasNoUser – If you provide a contact object without user.

Me.approve_comment(comment_id: Union[str, int, Comment]) bool#
Approve comment. the comment will be visible in your profile.
  • You can only approve comments that posted on your own profile.

  • You can always ignore it with ignore_comment().

  • You can approve delete it with delete_comment().

  • If the comment already approved, you get True anyway.

>>> me.approve_comment(comment_id=123)
Parameters:

comment_id (str | int | Comment) – Comment id from get_comments(). or just Comment object.

Returns:

Is approve success.

Return type:

bool

Me.ignore_comment(comment_id: Union[str, int, Comment]) bool#
Ignore comment. the comment will not be visible in your profile.
  • you can always approve it with approve_comment().)

  • You can only ignore comments that posted on your own profile.

>>> me.ignore_comment(comment_id=123)
Parameters:

comment_id (int | str | Comment) – Comment id from get_comments(). or just Comment object.

Returns:

Is deleting success.

Return type:

bool

Me.delete_comment(comment_id: Union[str, int, Comment]) bool#
Delete comment.
  • You can only delete comments that posted on your own profile or that posted by you.

>>> me.delete_comment(comment_id=123)
Parameters:

comment_id (int | str | Comment) – Comment id from get_comments(). or just Comment object.

Returns:

Is deleting success.

Return type:

bool

Me.like_comment(comment_id: Union[int, str, Comment]) bool#
Like comment.
  • If the comment is already liked, you get True anyway.

  • If the comment not approved, you get False.

>>> me.like_comment(comment_id=123)
Parameters:

comment_id (int | str | Comment) – Comment id from get_comments(). or just Comment object.

Returns:

Is like success.

Return type:

bool

Me.unlike_comment(comment_id: Union[int, str, Comment]) bool#
Unlike comment.
  • If the comment is already unliked, you get True anyway.

  • If the comment not approved, you get False.

>>> me.unlike_comment(comment_id=123)
Parameters:

comment_id (int | str | Comment) – Comment id from get_comments(). or just Comment object.

Returns:

Is unlike success.

Return type:

bool

Me.block_comments(uuid: Union[str, Comment, Profile, User, Contact]) bool#
Block comments from user.
  • If the user is already blocked, you get True anyway.

  • There is no apparent way to unblock comments. Use only when you are sure!

>>> me.block_comments(uuid='xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
Parameters:

uuid (str | User | Profile | Contact | Comment) – uuid of the user or Profile, User, Contact or Comment objects.

Returns:

Is block success.

Return type:

bool

Raises:

ContactHasNoUser – If the contact object has no user.

Me.suggest_turn_on_comments(uuid: Union[str, Profile, User, Contact]) bool#

Ask another user to turn on comments in his profile.

>>> me.suggest_turn_on_comments('d4c7b2c0-5b5a-4b4b-9c1c-8c7b6a5b4c3d')
Parameters:

uuid (str | Profile | User | Contact) – uuid, Profile, User, or Contact of the commented user.

Returns:

Is request success.

Return type:

bool

Raises:

ContactHasNoUser – If you provide Contact without user.

πŸ‘€ Account#

Me.get_uuid(phone_number: Union[int, str] = None) Optional[str]#

Get user’s uuid (To use in get_profile(), get_comments() and more).

>>> me.get_uuid(phone_number=972545416627)
'f7930d0f-c8ba-425b-8478-013968f30466'
Parameters:

phone_number (str | int | None) – International phone number format. Default: None (Return self uuid).

Returns:

String of uuid, or None if no user exists on the provided phone number.

Return type:

str | None

Me.get_saved_contacts() List[User]#

Get all the contacts stored in your contacts (Which has an Me account).

>>> saved_contacts = me.get_unsaved_contacts()
>>> for usr in saved_contacts: print(usr.name)
Returns:

List of saved contacts.

Return type:

List[User]

Me.get_unsaved_contacts() List[User]#

Get all the contacts that not stored in your contacts (Which has an Me account).

>>> unsaved_contacts = me.get_unsaved_contacts()
>>> for usr in unsaved_contacts: print(usr.name)
Returns:

List of unsaved contacts.

Return type:

List[User]

Me.block_profile(phone_number: Union[str, int], block_contact=True, me_full_block=True) BlockedNumber#

Block user profile.

>>> me.block_profile(phone_number=123456789, block_contact=True, me_full_block=False)
Parameters:
  • phone_number (str | int) – User phone number in international format.

  • block_contact (bool) – To block for calls. Default: True.

  • me_full_block (bool) – To block for social. Default: True.

Returns:

BlockedNumber object.

Return type:

BlockedNumber

Me.unblock_profile(phone_number: int, unblock_contact=True, me_full_unblock=True) bool#

Unblock user profile.

>>> me.unblock_profile(phone_number=123456789, unblock_contact=True, me_full_unblock=False)
Parameters:
  • phone_number (str | int) – User phone number in international format.

  • unblock_contact (bool) – To unblock for calls. Default: True.

  • me_full_unblock (bool) – To unblock for social. Default: True.

Returns:

Is successfully unblocked.

Return type:

bool

Me.block_numbers(numbers: Union[int, str, List[Union[int, str]]]) bool#

Block phone numbers.

>>> me.block_numbers(numbers=[123456789, 987654321])
Parameters:

numbers (int | str | List[int | str]) – Single or list of phone numbers in international format.

Returns:

Is blocked success.

Return type:

bool

Me.unblock_numbers(numbers: Union[int, List[int]]) bool#

Unblock numbers.

>>> me.unblock_numbers(numbers=[123456789, 987654321])
Parameters:

numbers (int | List[int]) – Single or list of phone numbers in international format. See get_blocked_numbers().

Returns:

Is unblocking success.

Return type:

bool

Me.get_blocked_numbers() List[BlockedNumber]#

Get list of your blocked numbers. See unblock_numbers().

>>> me.get_blocked_numbers()
[BlockedNumber(phone_number=123456789, block_contact=True, me_full_block=True]
Returns:

List of blocked_number.BlockedNumber objects.

Return type:

List[BlockedNumber]

Me.upload_random_data(count: int = 50, contacts=False, calls=False, location=False) bool#

Upload random data to your account.

>>> me.upload_random_data(count=50, contacts=True, calls=True, location=True)
Parameters:
  • count (int) – Count of random data to upload. Default: 50.

  • contacts (bool) – To upload random contacts data. Default: False.

  • calls (bool) – To upload random calls data. Default: False.

  • location (bool) – To upload random location data. Default: False.

Returns:

Is uploading success.

Return type:

bool

Me.suspend_account(yes_im_sure: bool = False) bool#

Suspend your account until your next login.

>>> me.suspend_account(yes_im_sure=True)
Parameters:

yes_im_sure (bool) – True to suspend your account and ignore prompt. Default: False.

Returns:

Is suspended.

Return type:

bool

Me.delete_account(yes_im_sure: bool = False) bool#

Delete your account and it’s data (!!!)

>>> me.delete_account(yes_im_sure=True)
True
Parameters:

yes_im_sure (bool) – True to delete your account and ignore prompt. Default: False.

Returns:

Is deleted.

Return type:

bool

Me.add_contacts(contacts: List[Dict[str, Optional[Union[str, int]]]]) dict#

Upload new contacts to your Me account. See upload_random_data().

>>> contacts = [{'country_code': 'XX', 'date_of_birth': None, 'name': 'Chandler', 'phone_number': 512145887}]
>>> me.add_contacts(contacts=contacts)
Parameters:

contacts (List[dict])) – List of dicts with contacts data.

Returns:

Dict with upload results.

Return type:

dict

Example of list of contacts to add:

[
    {
        "country_code": "XX",
        "date_of_birth": None,
        "name": "Chandler",
        "phone_number": 512145887,
    }
]
Me.remove_contacts(contacts: List[Dict[str, Optional[Union[str, int]]]]) dict#

Remove contacts from your Me account.

>>> contacts = [{'country_code': 'XX', 'date_of_birth': None, 'name': 'Chandler', 'phone_number': 512145887}]
>>> me.remove_contacts(contacts=contacts)
Parameters:

contacts (List[dict]) – List of dicts with contacts data.

Returns:

Dict with upload results.

Return type:

dict

Example of list of contacts to remove:

[
    {
        "country_code": "XX",
        "date_of_birth": None,
        "name": "Chandler",
        "phone_number": 512145887,
    }
]
Me.add_calls_to_log(calls: List[Dict[str, Optional[Union[str, int]]]]) List[Call]#

Add call to your calls log. See upload_random_data().

>>> calls = [{'called_at': '2021-07-29T11:27:50Z', 'duration': 28, 'name': '043437535', 'phone_number': 43437535, 'tag': None, 'type': 'missed'}]
>>> me.add_calls_to_log(calls=calls)
Parameters:

calls (List[dict]) – List of dicts with calls data.

Returns:

dict with upload result.

Return type:

dict

Example of list of calls to add:

[
    {
        "called_at": "2021-07-29T11:27:50Z",
        "duration": 28,
        "name": "043437535",
        "phone_number": 43437535,
        "tag": None,
        "type": "missed",
    }
]
Me.remove_calls_from_log(calls: List[Dict[str, Optional[Union[str, int]]]]) List[Call]#

Remove calls from your calls log.

>>> calls = [{'called_at': '2021-07-29T11:27:50Z', 'duration': 28, 'name': '043437535', 'phone_number': 43437535, 'tag': None, 'type': 'missed'}]
>>> me.remove_calls_from_log(calls=calls)
Parameters:

calls (List[dict]) – List of dicts with calls data.

Returns:

dict with upload result.

Return type:

dict

Example of list of calls to remove:

[
    {
        "called_at": "2021-07-29T11:27:50Z",
        "duration": 28,
        "name": "043437535",
        "phone_number": 43437535,
        "tag": None,
        "type": "missed",
    }
]

πŸ“ Location#

Me.update_location(latitude: float, longitude: float) bool#

Update your location. See upload_random_data().

>>> me.update_location(35.6892, 51.3890)
Parameters:
  • latitude (float) – location latitude coordinates.

  • longitude (float) – location longitude coordinates.

Returns:

Is location update success.

Return type:

bool

Raises:

ValueError – If latitude or longitude is not a float.

Me.suggest_turn_on_location(uuid: Union[str, Profile, User, Contact]) bool#

Ask another user to share his location with you.

>>> me.suggest_turn_on_location('d4c7b2c0-5b5a-4b4b-9c1c-8c7b6a5b4c3d')
Parameters:

uuid (str | Profile | User | Contact) – uuid, Profile, User, or Contact of the user.

Returns:

Is request success.

Return type:

bool

Raises:

ContactHasNoUser – If you provide Contact without user.

Me.share_location(uuid: Union[str, Profile, User, Contact]) bool#

Share your location with another user.

>>> me.share_location('d4c7b2c0-5b5a-4b4b-9c1c-8c7b6a5b4c3d')
Parameters:

uuid (str | Profile | User | Contact) – uuid of the user or Profile, User, or Contact objects.

Returns:

Is sharing success.

Return type:

bool

Me.stop_sharing_location(uuids: Union[str, Profile, User, Contact, List[Union[str, Profile, User, Contact]]]) bool#

Stop sharing your update_location() with users.

>>> me.stop_sharing_location('d4c7b2c0-5b5a-4b4b-9c1c-8c7b6a5b4c3d')
Parameters:

uuids (str | Profile | User | Contact | List[str | Profile | User | Contact]) – uuid/s of the user/s that you want to stop sharing your location with.

Returns:

is stopping success.

Return type:

bool

Me.stop_shared_location(uuids: Union[str, Profile, User, Contact, List[Union[str, Profile, User, Contact]]]) bool#

Stop locations that shared with you.

>>> me.stop_shared_location('d4c7b2c0-5b5a-4b4b-9c1c-8c7b6a5b4c3d')
Parameters:

uuids (str | Profile | User | Contact | List[str | Profile | User | Contact]) – uuid/s of the user/s that you want to stop sharing your location with.

Returns:

is stopping success.

Return type:

bool

Me.locations_shared_by_me() List[User]#

Get list of users that you shared your location with them.

>>> me.locations_shared_by_me()
[User(name='John Doe', uuid='d4c7b2c0-5b5a-4b4b-9c1c-8c7b6a5b4c3d', ...)]
Returns:

List of User objects.

Return type:

List[User]

Me.locations_shared_with_me() List[User]#

Get users who have shared their location with you.

>>> me.locations_shared_with_me()
[User(name='John Doe', uuid='d4c7b2c0-5b5a-4b4b-9c1c-8c7b6a5b4c3d', ...)]
Returns:

List of User objects (with distance attribute).

Return type:

List[User]

πŸ”” Notifications#

Me.unread_notifications_count() int#

Get count of unread notifications.

>>> me.unread_notifications_count()
25
Returns:

count of unread notifications.

Return type:

int

Me.get_notifications(page: int = 1, limit: int = 20, names_filter: bool = False, system_filter: bool = False, comments_filter: bool = False, who_watch_filter: bool = False, who_deleted_filter: bool = False, birthday_filter: bool = False, location_filter: bool = False) List[Notification]#

Get app notifications: new names, birthdays, comments, watches, deletes, location shares and system notifications.

>>> me.get_notifications(limit=300, names_filter=True, system_filter=True)
[Notification(id=109, category='JOINED_ME', is_read=False, created_at=datetime.datetime(2020, 1, 1), ...),]
Parameters:
  • page (int) – get_notifications().``count`` / page_size. Default: 1.

  • limit (int) – Limit of notifications in each page. Default: 20.

  • names_filter (bool) – New names, deletes, joined, renames, rename requests. Default: False.

  • system_filter (bool) – System notifications: spam reports, your name requests, suggestions to turn on mutual contacts. Default: False.

  • comments_filter (bool) – Comments notifications: new comments, published comments and suggestions to turn on comments (See get_comments()). Default: False.

  • who_watch_filter (bool) – Who watched your profile (See who_watched()). Default: False.

  • who_deleted_filter (bool) – Who deleted you from his contacts (See who_deleted()). Default: False.

  • birthday_filter (bool) – Contacts birthdays. Default: False.

  • location_filter (bool) – Shared locations: suggestions to turn on location, locations that shared with you. Default: False.

Returns:

List of Notification objects.

Return type:

List[Notification]

Me.read_notification(notification_id: Union[int, str, Notification]) bool#

Mark notification as read.

>>> me.read_notification(109)
True
Parameters:

notification_id (int | str | Notification) – Notification id from get_notifications() or Notification object.

Returns:

Is read success.

Return type:

bool

βš™οΈSettings#

Me.get_settings() Settings#

Get current settings.

>>> # Take control of your privacy:
>>> my_settings = me.get_settings()
>>> my_settings.who_watched_enabled = False
>>> my_settings.who_deleted_enabled = False
>>> my_settings.mutual_contacts_available = False
>>> my_settings.comments_enabled = False
>>> my_settings.location_enabled = False
Returns:

Settings object.

Return type:

Settings

Me.change_settings(mutual_contacts_available: bool = None, who_watched_enabled: bool = None, who_deleted_enabled: bool = None, comments_enabled: bool = None, location_enabled: bool = None, language: str = None, who_deleted_notification_enabled: bool = None, who_watched_notification_enabled: bool = None, distance_notification_enabled: bool = None, system_notification_enabled: bool = None, birthday_notification_enabled: bool = None, comments_notification_enabled: bool = None, names_notification_enabled: bool = None, notifications_enabled: bool = None) Tuple[bool, Settings]#

Change social, app and notification settings.

>>> me.change_settings(language='en', mutual_contacts_available=False)
(True, Settings(language='en', mutual_contacts_available=False, ...))
Parameters:
  • mutual_contacts_available (bool) – Show common contacts between users. Default: None.

  • who_watched_enabled (bool) – Users will be notified that you have viewed their profile. Default: None. - They will only be able to get information about you if they are premium users (is_premium = True in get_profile()) or, by using meapi ;) - This setting must be True if you want to use who_watched() method.

  • who_deleted_enabled (bool) – Users will be notified that you have deleted them from your contact book. Default: None. - They will only be able to get information about you if they are premium users (is_premium = True in get_profile()) or, by using meapi ;) - This setting must be True if you want to use who_deleted() method.

  • comments_enabled (bool) – Allow users to publish comment (publish_comment()) in your profile. Default: None. - Comments will not be posted until you approve them with approve_comment().

  • location_enabled (bool) – Allow shared locations. Default: None.

  • language (str) – lang code: iw, en, etc. (For notifications text). Default: None.

  • who_deleted_notification_enabled (bool) – Default: None.

  • who_watched_notification_enabled (bool) – Default: None.

  • distance_notification_enabled (bool) – Default: None.

  • system_notification_enabled (bool) – Default: None.

  • birthday_notification_enabled (bool) – Default: None.

  • comments_notification_enabled (bool) – Default: None.

  • names_notification_enabled (bool) – Default: None.

  • notifications_enabled (bool) – Default: None.

Raises:

TypeError – If you don’t change any setting.

Returns:

Tuple: Is success, Settings object.

Return type:

Tuple[bool, Settings]

πŸ”© Advanced#

Me.login(activation_code: Optional[str] = None, new_account_details: Optional[NewAccountDetails] = None, interactive_mode: bool = False) bool#

Login to MeApi.

  • If you initialized the Me class directly, this method will be called automatically. No need to call it.

  • If activation_code is not provided and interactive_mode is True the method will prompt for activation code.

  • If the account is new and new_account_details is not provided and interactive_mode is True the method will prompt for new account details.

Parameters:
  • activation_code (str | None) – You can pass the activation code if you want to skip the prompt. Default: None.

  • new_account_details (NewAccountDetails | None) – You can pass the new account details if you want to skip the prompt in case of new account. Default: None.

  • interactive_mode (bool) – If True the method will prompt for activation code (and new account details in case of new account). Default: False.

Raises:
  • NeedActivationCode – If activation_code is not provided and interactive_mode is False.

  • IncorrectActivationCode – If the activation code is incorrect and interactive_mode is False.

  • ActivationCodeExpired – If the activation code is expired and interactive_mode is False.

  • MaxValidateReached – If activation_code is incorrect for a few times.

  • NewAccountException – If the account is new and new_account_details is not provided and interactive_mode is False.

  • BrokenCredentialsManager – If the credentials manager is broken (if authentication succeeded but the credentials manager failed to save the credentials).

Returns:

Is login succeeded.

Return type:

bool

Me.logout() bool#
Logout from Me account (And delete credentials, depends on the credentials manager implementation).
  • If you want to login again, you need to call login() or create a new instance of Me.

  • If you try to use any method that requires authentication, you will get a NotLoggedIn exception.

Returns:

Is success.

Type:

bool

Me.make_request(method: Union[str, RequestType], endpoint: str, body: Dict[str, Any] = None, headers: Dict[str, Union[str, int]] = None, files: Dict[str, bytes] = None, max_retries: int = 3) Union[Dict[str, Any], List[Dict[str, Any]]]#

Make a raw request to Me API.

>>> me.make_request('GET', '/main/users/profile/me/')
>>> me.make_request('PATCH', '/main/users/profile/', body={'name': 'Chandler Bing'})
Parameters:
  • method (str | RequestType) – Request method. Can be GET, POST, PUT, DELETE, PATCH, HEAD or OPTIONS.

  • endpoint (str) – API endpoint. e.g. /main/users/profile/me/.

  • body (dict) – The body of the request. Default: None.

  • headers (dict) – Use different headers instead of the default ones. Default: None.

  • files (dict) – Files to send with the request. Default: None.

  • max_retries (int) – Maximum number of retries in case of failure. Default: 3.

Raises:
  • MeApiException – If HTTP status is higher than 400.

  • ValueError – If the response received does not contain a valid JSON or the request type is not valid.

  • ConnectionError – If the request failed.

Returns:

API response as dict or list.

Return type:

dict | list