From d992b9bb8c687c4ae6bff545edd303c6b58d4124 Mon Sep 17 00:00:00 2001 From: halcy Date: Sat, 19 Nov 2022 01:29:14 +0200 Subject: Add account lookup API --- mastodon/Mastodon.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'mastodon') diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 629a4b2..6e5bc29 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -1261,6 +1261,19 @@ class Mastodon: url = '/api/v1/accounts/{0}/lists'.format(str(id)) return self.__api_request('GET', url, params) + @api_version("3.4.0", "3.4.0", __DICT_VERSION_ACCOUNT) + def account_lookup(self, acct): + """ + Look up an account from user@instance form (@instance allowed but not required for + local accounts). Will only return accounts that the instance already knows about, + and not do any webfinger requests. Use `account_search` if you need to resolve users + through webfinger from remote. + + Returns an `account dict`_. + """ + return self.__api_request('GET', '/api/v1/accounts/lookup', self.__generate_params(locals())) + + ### # Reading data: Featured hashtags ### -- cgit v1.2.3