getUser
getUser(params)
Get a user.
Example:
const { data: user } = await audiusSdk.users.getUser({
id: 'eAZl3',
})
console.log(user)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
id | string | The ID of the user | Required |
Returns
Returns a Promise containing an object with a data field. data contains information about the
user as described below.
{
albumCount: number;
artistPickTrackId?: string;
bio?: string;
coverPhoto?: {
_2000?: string;
_640?: string;
};
doesFollowCurrentUser?: boolean;
ercWallet: string;
followeeCount: number;
followerCount: number;
handle: string;
id: string;
isAvailable: boolean;
isDeactivated: boolean;
isVerified: boolean;
location?: string;
name: string;
playlistCount: number;
profilePicture?: {
_1000x1000?: string;
_150x150?: string;
_480x480?: string;
};
repostCount: number;
splWallet: string;
supporterCount: number;
supportingCount: number;
totalAudioBalance: number;
trackCount: number;
};getBulkUsers
getBulkUsers(params)
Gets a list of users.
Example:
const { data: users } = await audiusSdk.users.getBulkUsers({
id: ['eAZl3', 'v7O9O'],
})
console.log(users)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
id | string[] | The IDs of the users | Optional |
userId | string | The ID of the user making the request | Optional |
Returns
Returns an array of users, see getUser.
getAIAttributedTracksByUserHandle
getAIAttributedTracksByUserHandle(params)
Get the AI generated tracks attributed to a user using the user's handle.
Example:
const { data: tracks } = await audiusSdk.users.getAIAttributedTracksByUserHandle({
handle: 'skrillex',
})
console.log(tracks)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
handle | string | The handle of the user | Required |
limit | number | The maximum number of tracks to return. Default value is 10 | Optional |
offset | number | The offset to apply to the list of results. Default value is 0 | Optional |
filterTracks | GetAIAttributedTracksByUserHandleFilterTracksEnum (can be imported from @audius/sdk) | A filter to apply to the returned tracks. Default value is GetAIAttributableTracksByUserHandleFilterTracksEnum.All | Optional |
query | string | A query to search for in a user's tracks | Optional |
sortDirection | GetAIAttributedTracksByUserHandleSortDirectionEnum (can be imported from @audius/sdk) | A sort direction to apply to the returned tracks. Default value is GetAIAttributableTracksByUserHandleSortDirectionEnum.Asc | Optional |
sortMethod | GetAIAttributedTracksByUserTracksByUserHandleSortMethodEnum (can be imported from @audius/sdk) | A sort method to apply to the returned tracks | Optional |
Returns
The return type is the same as getBulkTracks
getAuthorizedApps
getAuthorizedApps(params)
Get the apps that a user has authorized to write to their account.
Example:
const { data: apps } = await audiusSdk.users.getAuthorizedApps({
id: 'eAZl3',
})
console.log(apps)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
id | string | The ID of the user | Required |
Returns
Returns a Promise containing an object with a data field. data is an array of items containing
information about the authorized apps as described below.
{
address: string;
description?: string;
grantCreatedAt: string;
grantUpdatedAt: string;
grantorUserId: string;
name: string;
}[];getConnectedWallets
getConnectedWallets(params)
Get a user's connected ERC and SPL wallets.
Example:
const { data: wallets } = await audiusSdk.users.getConnectedWallets({
id: 'eAZl3',
})
console.log(wallets)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
id | string | The ID of the user | Required |
Returns
Returns a Promise containing an object with a data field. data is an object containing
information about the wallets as described below.
{
ercWallets: string[];
splWallets: string[];
};getFavorites
getFavorites(params)
Get a user's favorites.
Example:
const { data: favorites } = await audiusSdk.users.getFavorites({
id: 'eAZl3',
})
console.log(favorites)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
id | string | The ID of the user | Required |
Returns
Returns a Promise containing an object with a data field. data is an array of items containing
information about the favorites as described below.
{
createdAt: string
favoriteItemId: string // The ID of the track, playlist, or album
favoriteType: string // The type of favorite ("track", "playlist", or "album")
userId: string
}
;[]getFollowers
getFollowers(params)
Get a user's followers
Example:
const { data: followers } = await audiusSdk.users.getFollowers({
id: 'eAZl3',
})
console.log(followers)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
id | string | The ID of the user | Required |
limit | number | The maximum number of followers to return. Default value is 10 | Optional |
offset | number | The offset to apply to the list of results. Default value is 0 | Optional |
userId | string | The ID of the user making the request | Optional |
Returns
Returns a Promise containing an object with a data field. data is an array of items containing
information about the followers as described below.
{
albumCount: number;
artistPickTrackId?: string;
bio?: string;
coverPhoto?: {
_2000?: string;
_640?: string;
};
doesFollowCurrentUser?: boolean;
ercWallet: string;
followeeCount: number;
followerCount: number;
handle: string;
id: string;
isAvailable: boolean;
isDeactivated: boolean;
isVerified: boolean;
location?: string;
name: string;
playlistCount: number;
profilePicture?: {
_1000x1000?: string;
_150x150?: string;
_480x480?: string;
};
repostCount: number;
splWallet: string;
supporterCount: number;
supportingCount: number;
totalAudioBalance: number;
trackCount: number;
}[];getFollowing
getFollowing(params)
Get users that a user is following
Example:
const { data: following } = await audiusSdk.users.getFollowing({
id: 'eAZl3',
})
console.log(following)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
id | string | The ID of the user | Required |
limit | number | The maximum number of users to return. Default value is 10 | Optional |
offset | number | The offset to apply to the list of results. Default value is 0 | Optional |
userId | string | The ID of the user making the request | Optional |
Returns
The return type is the same as getFollowers
getRelatedUsers
getRelatedUsers(params)
Get a list of users that might be of interest to followers of this user.
Example:
const { data: relatedUsers } = await audiusSdk.users.getRelatedUsers({
id: 'eAZl3',
})
console.log(relatedUsers)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
id | string | The ID of the user | Required |
limit | number | The maximum number of users to return. Default value is 10 | Optional |
offset | number | The offset to apply to the list of results. Default value is 0 | Optional |
userId | string | The ID of the user making the request | Optional |
filterFollowed | boolean | Filter to only users that the current user follows | Optional |
Returns
The return type is the same as getFollowers
getReposts(params)
Get a user's reposts.
Example:
const { data: reposts } = await audiusSdk.users.getReposts({
id: 'eAZl3',
})
console.log(reposts)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
id | string | The ID of the user | Required |
limit | number | The maximum number of reposts to return. Default value is 100 | Optional |
offset | number | The offset to apply to the list of results. Default value is 0 | Optional |
userId | string | The ID of the user making the request | Optional |
Returns
Returns a Promise containing an object with a data field. data is an array of items containing
information about the reposts as described below.
Return type:
{
item?: {
id: string;
}; // The entire item is returned, always contains id
itemType?: string; // The type of the item ("track", "playlist", or "album")
timestamp?: string;
}[];getSubscribers
getSubscribers(params)
Get users that are subscribed to a user.
Example:
const { data: subscribers } = await audiusSdk.users.getSubscribers({
id: 'eAZl3',
})
console.log(subscribers)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
id | string | The ID of the user | Required |
limit | number | The maximum number of users to return. Default value is 10 | Optional |
offset | number | The offset to apply to the list of results. Default value is 0 | Optional |
userId | string | The ID of the user making the request | Optional |
Returns
The return type is the same as getFollowers
getSupporters
getSupporters(params)
Get users that are supporting a user (they have sent them a tip).
Example:
const { data: supporters } = await audiusSdk.users.getSupporters({
id: 'eAZl3',
})
console.log(supporters)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
id | string | The ID of the user | Required |
limit | number | The maximum number of users to return. Default value is 10 | Optional |
offset | number | The offset to apply to the list of results. Default value is 0 | Optional |
userId | string | The ID of the user making the request | Optional |
Returns
Returns
Returns a Promise containing an object with a data field. data is an array of items containing
information about the supporters as described below.
{
amount: string;
rank: number;
sender: {
albumCount: number;
artistPickTrackId?: string;
bio?: string;
coverPhoto?: {
_2000?: string;
_640?: string;
};
doesFollowCurrentUser?: boolean;
ercWallet: string;
followeeCount: number;
followerCount: number;
handle: string;
id: string;
isAvailable: boolean;
isDeactivated: boolean;
isVerified: boolean;
location?: string;
name: string;
playlistCount: number;
profilePicture?: {
_1000x1000?: string;
_150x150?: string;
_480x480?: string;
};
repostCount: number;
splWallet: string;
supporterCount: number;
supportingCount: number;
totalAudioBalance: number;
trackCount: number;
};
}[];getSupportedUsers
getSupportedUsers(params)
Get users that a user is supporting (they have sent them a tip).
Example:
const { data: supportedUsers } = await audiusSdk.users.getSupportedUsers({
id: 'eAZl3',
})
console.log(supportedUsers)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
id | string | The ID of the user | Required |
limit | number | The maximum number of users to return. Default value is 10 | Optional |
offset | number | The offset to apply to the list of results. Default value is 0 | Optional |
userId | string | The ID of the user making the request | Optional |
Returns
Returns a Promise containing an object with a data field. data is an array of items containing
information about the supported users as described below.
{
amount: string;
rank: number;
receiver: {
albumCount: number;
artistPickTrackId?: string;
bio?: string;
coverPhoto?: {
_2000?: string;
_640?: string;
};
doesFollowCurrentUser?: boolean;
ercWallet: string;
followeeCount: number;
followerCount: number;
handle: string;
id: string;
isAvailable: boolean;
isDeactivated: boolean;
isVerified: boolean;
location?: string;
name: string;
playlistCount: number;
profilePicture?: {
_1000x1000?: string;
_150x150?: string;
_480x480?: string;
};
repostCount: number;
splWallet: string;
supporterCount: number;
supportingCount: number;
totalAudioBalance: number;
trackCount: number;
};
}[];getTopTrackTags
getTopTrackTags(params)
Get the most used track tags by a user.
Example:
const { data: tags } = await audiusSdk.users.getTopTrackTags({
id: 'eAZl3',
})
console.log(tags)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
id | string | The ID of the user | Required |
limit | number | The maximum number of tags to return. Default value is 10 | Optional |
userId | string | The ID of the user making the request | Optional |
Returns
Returns a Promise containing an object with a data field. data is an array of strings
representing the tags
string[]getTracksByUser
getTracksByUser(params)
Get a user's tracks.
Example:
const { data: tracks } = await audiusSdk.users.getTracksByUser({
id: 'eAZl3',
})
console.log(tracks)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
id | string | The ID of the user | Required |
limit | number | The maximum number of tracks to return. Default value is 10 | Optional |
offset | number | The offset to apply to the list of results. Default value is 0 | Optional |
filterTracks | GetTracksByUserFilterTracksEnum (can be imported from @audius/sdk) | A filter to apply to the returned tracks. Default value is GetTracksByUserFilterTracksEnum.All | Optional |
query | string | A query to search for in a user's tracks | Optional |
sortDirection | GetTracksByUserSortDirectionEnum (can be imported from @audius/sdk) | A sort direction to apply to the returned tracks. Default value is GetTracksByUserSortDirectionEnum.Asc | Optional |
sortMethod | GetTracksByUserSortMethodEnum (can be imported from @audius/sdk) | A sort method to apply to the returned tracks | Optional |
Returns
The return type is the same as getBulkTracks
getUserByHandle
getUserByHandle(params)
Get a user by their handle.
Example:
const { data: user } = await audiusSdk.users.getUserByHandle({
handle: 'skrillex',
})
console.log(user)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
handle | string | The handle of the user | Required |
userId | string | The ID of the user making the request | Optional |
Returns
The return type is the same as getUser
searchUsers
searchUsers(params)
Search for users.
Example:
const { data: users } = await audiusSdk.users.searchUsers({
query: 'skrillex',
})
console.log(users)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
query | string | The query for which to search | Optional |
offset | number | The number of items to skip (for pagination) | Optional |
limit | number | The number of items to fetch (for pagination) | Optional |
genre | Genre[] | Array of genres to filter by | Optional |
sortMethod | string | Sort method: 'relevant', 'popular', or 'recent' | Optional |
isVerified | string | Filter to only verified users | Optional |
Returns
The return type is the same as getFollowers
updateUser
updateUser(params, requestInit?)
Update a user profile. To update a profile picture or cover photo, first upload the image via the
Uploads API and pass the resulting CID in metadata.
Example:
import fs from 'fs'
// Upload a new profile picture
const profilePicBuffer = fs.readFileSync('path/to/profile-pic.png')
const profilePicUpload = audiusSdk.uploads.createImageUpload({
file: {
buffer: Buffer.from(profilePicBuffer),
name: 'profilePic.png',
},
})
const profilePicCid = await profilePicUpload.start()
await audiusSdk.users.updateUser({
id: '7eP5n',
userId: '7eP5n',
metadata: {
bio: 'up and coming artist from the Bronx',
profilePicture: profilePicCid,
},
})params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
id | string | The ID of the user | Required |
userId | string | The ID of the user (same as id) | Required |
metadata | UpdateUserRequestBody | An object with details about the user | Required |
UpdateUserRequestBody — all fields are optional, only include the fields you want to change:
| Name | Type | Description |
|---|---|---|
name | string | Display name |
handle | string | User handle (set only if not already set) |
bio | string | User bio |
location | string | User location |
website | string | Website URL |
donation | string | Donation link |
twitterHandle | string | Twitter handle (without @) |
instagramHandle | string | Instagram handle (without @) |
tiktokHandle | string | TikTok handle (without @) |
profilePicture | string | Profile picture CID or URL (from Uploads API) |
profilePictureSizes | string | Profile picture sizes metadata |
coverPhoto | string | Cover photo CID or URL (from Uploads API) |
coverPhotoSizes | string | Cover photo sizes metadata |
profileType | 'label' | null | Set to 'label' for record label profiles |
isDeactivated | boolean | Whether the user is deactivated |
artistPickTrackId | string | Track hash ID for artist pick |
allowAiAttribution | boolean | Whether to allow AI attribution |
splUsdcPayoutWallet | string | Solana USDC payout wallet address |
coinFlairMint | string | Coin flair mint address |
requestInit
You can pass an optional
RequestInit object as the second
argument to customize the underlying fetch request (e.g. set custom headers, abort signal, etc.).
Returns
Returns a Promise containing an object with the block hash (blockHash) and block number
(blockNumber) for the transaction.
{
blockHash: string
blockNumber: number
}followUser
followUser(params, requestInit?)
Follow a user.
Example:
await audiusSdk.users.followUser({
userId: '7eP5n',
followeeUserId: '2kN2a', // User id to follow
})params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
userId | string | The ID of the user | Required |
followeeUserId | string | The ID of the user to follow | Required |
requestInit
You can pass an optional
RequestInit object as the second
argument to customize the underlying fetch request (e.g. set custom headers, abort signal, etc.).
Returns
Returns a Promise containing an object with the block hash (blockHash) and block number
(blockNumber) for the transaction.
{
blockHash: string
blockNumber: number
}unfollowUser
unfollowUser(params, requestInit?)
Unfollow a user.
Example:
await audiusSdk.users.unfollowUser({
userId: '7eP5n',
followeeUserId: '2kN2a', // User id to unfollow
})params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
userId | string | The ID of the user | Required |
followeeUserId | string | The ID of the user to unfollow | Required |
requestInit
You can pass an optional
RequestInit object as the second
argument to customize the underlying fetch request (e.g. set custom headers, abort signal, etc.).
Returns
Returns a Promise containing an object with the block hash (blockHash) and block number
(blockNumber) for the transaction.
{
blockHash: string
blockNumber: number
}subscribeToUser
subscribeToUser(params, requestInit?)
Subscribe to a user.
Example:
await audiusSdk.users.subscribeToUser({
userId: '7eP5n',
subscribeeUserId: '2kN2a', // User id to subscribe to
})params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
userId | string | The ID of the user | Required |
subscribeeUserId | string | The ID of the user to subscribe to | Required |
requestInit
You can pass an optional
RequestInit object as the second
argument to customize the underlying fetch request (e.g. set custom headers, abort signal, etc.).
Returns
Returns a Promise containing an object with the block hash (blockHash) and block number
(blockNumber) for the transaction.
{
blockHash: string
blockNumber: number
}unsubscribeFromUser
unsubscribeFromUser(params, requestInit?)
Unsubscribe from a user.
Example:
await audiusSdk.users.unsubscribeFromUser({
userId: '7eP5n',
subscribeeUserId: '2kN2a', // User id to unsubscribe from
})params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
userId | string | The ID of the user | Required |
subscribeeUserId | string | The ID of the user to unsubscribe from | Required |
requestInit
You can pass an optional
RequestInit object as the second
argument to customize the underlying fetch request (e.g. set custom headers, abort signal, etc.).
Returns
Returns a Promise containing an object with the block hash (blockHash) and block number
(blockNumber) for the transaction.
{
blockHash: string
blockNumber: number
}