# Getting started

WARNING

Node.js version 12 or greater is required.

Install into your project:

# Usage info

Opensoundcloud only works in Node.js, because CORS is neither enabled for the APIv2 nor for web-scraping.

Therefore, using opensoundcloud on the server or in an environment where CORS is required.

# Basic example

import { user } from "opensoundcloud"

const userData = await user("noisia")

or

import osc from "opensoundcloud"

const userData = await osc.user(51999125)

both will return the users data, which looks something like this:

userData
{
  "avatar_url": "https://i1.sndcdn.com/avatars-000451809714-n5njwk-large.jpg",
  "city": "",
  "comments_count": 28,
  "country_code": null,
  "created_at": "2009-05-11T16:14:44Z",
  "creator_subscriptions": [
    {
      "product": {
        "id": "creator-pro-unlimited"
      }
    }
  ],
  "creator_subscription": {
    "product": {
      "id": "creator-pro-unlimited"
    }
  },
  "description": "Noisia comprise Dutch producers Thijs, Nik and Martijn. Largely regarded as one of the most distinctive, powerful acts to emerge in bass music, their production techniques are referenced and praised across the entire electronic music scene. Their extensive body of work also includes the game Devil May Cry and the Foreign Beggars collaboration I Am Legion.",
  "followers_count": 3954185,
  "followings_count": 89,
  "first_name": "",
  "full_name": "",
  "groups_count": 0,
  "id": 116681,
  "kind": "user",
  "last_modified": "2021-01-13T12:34:24Z",
  "last_name": "",
  "likes_count": 53,
  "playlist_likes_count": 20,
  "permalink": "noisia",
  "permalink_url": "https://soundcloud.com/noisia",
  "playlist_count": 67,
  "reposts_count": null,
  "track_count": 488,
  "uri": "https://api.soundcloud.com/users/116681",
  "urn": "soundcloud:users:116681",
  "username": "NOISIA",
  "verified": true,
  "visuals": {
    "urn": "soundcloud:users:116681",
    "enabled": true,
    "visuals": [
      {
        "urn": "soundcloud:visuals:114449016",
        "entry_time": 0,
        "visual_url": "https://i1.sndcdn.com/visuals-000000116681-fL1pqB-original.jpg"
      }
    ],
    "tracking": null
  },
  "badges": {
    "pro": false,
    "pro_unlimited": true,
    "verified": true
  },
  "url": "/noisia"
}

Get more info in the API section