diff --git a/accounts.go b/accounts.go index 67fd68e..50746fe 100644 --- a/accounts.go +++ b/accounts.go @@ -55,6 +55,15 @@ type AccountSource struct { Fields *[]Field `json:"fields"` } +func LookupAccount(username string) (*Account, error) { + var account Account + err := doAPI(http.MethodGet, fmt.Sprintf("api/v1/accounts/lookup?acct=%s", url.QueryEscape(username)), nil, &account, nil) + if err != nil { + return nil, err + } + return &account, nil +} + func GetAccount(id ID) (*Account, error) { var account Account err := doAPI(http.MethodGet, fmt.Sprintf("/api/v1/accounts/%s", url.PathEscape(string(id))), nil, &account, nil)