Get User Data
Getting the user data is a simple process. You can use the getUser
method to get the user data. The getUser
method takes the user ID as an argument and returns the user data.
async function getUserData(userId) { try { const user = await vibify.getUser(userId); console.log('User Information:', user); } catch (error) { console.error('Error:', error); }}
getUserData('user-id');
Or with cURL:
curl -H "x-api-key: (your api key)" "http://localhost:3000/user/user-id"
Response
{ "display_name": "your-name", "external_urls": { "spotify": "https://open.spotify.com/user/your-name" }, "href": "https://api.spotify.com/v1/users/your-name", "id": "your-name", "images": [ { "url": "https://i.scdn.co/image/ab67757000003b825416b8f841b1b0260a71ecac", "height": 64, "width": 64 }, { "url": "https://i.scdn.co/image/ab6775700000ee855416b8f841b1b0260a71ecac", "height": 300, "width": 300 } ], "type": "user", "uri": "spotify:user:your-name", "followers": { "href": null, "total": 6 }, "country": "NL", "product": "free", "explicit_content": { "filter_enabled": false, "filter_locked": false }, "email": "your-email"}