(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{158:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){returni})),a.d(t,"metadata",(function(){returnc})),a.d(t,"rightToc",(function(){returnn})),a.d(t,"default",(function(){returno}));varr=a(2),l=a(9),b=(a(0),a(186)),i={id:"getting_started",title:"Getting Started",sidebar_label:"Getting Started"},c={id:"version-5.1.1/web/getting_started",title:"Getting Started",description:"This API provides full access to the new SpotifyWebAPI introduced here.",source:"@site/versioned_docs/version-5.1.1/web/getting_started.md",permalink:"/SpotifyAPI-NET/docs/web/getting_started",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/versioned_docs/version-5.1.1/web/getting_started.md",version:"5.1.1",lastUpdatedBy:"dependabot-preview[bot]",lastUpdatedAt:1594839392,sidebar_label:"Getting Started",sidebar:"version-5.1.1/someSidebar",previous:{title:"SpotifyAPI-NET",permalink:"/SpotifyAPI-NET/docs/home"},next:{title:"Albums",permalink:"/SpotifyAPI-NET/docs/web/albums"}},n=[{value:"First steps",id:"first-steps",children:[{value:"Imports",id:"imports",children:[]},{value:"Basic-Usage",id:"basic-usage",children:[]}]},{value:"Error-Handling",id:"error-handling",children:[]},{value:"Sync vs Asynchronous",id:"sync-vs-asynchronous",children:[]},{value:"API-Reference",id:"api-reference",children:[{value:"Albums",id:"albums",children:[]},{value:"Artists",id:"artists",children:[]},{value:"Browse",id:"browse",children:[]},{value:"Follow",id:"follow",children:[]},{value:"Library",id:"library",children:[]},{value:"Personalization",id:"personalization",children:[]},{value:"Player",id:"player",children:[]},{value:"Playlists",id:"playlists",children:[]},{value:"Profiles",id:"profiles",children:[]},{value:"Search",id:"search",children:[]},{value:"Tracks",id:"tracks",children:[]},{value:"Util",id:"util",children:[]}]}],s={rightToc:n};functiono(e){vart=e.components,a=Object(l.a)(e,["components"]);returnObject(b.b)("wrapper",Object(r.a)({},s,a,{components:t,mdxType:"MDXLayout"}),Object(b.b)("p",null,"This API provides full access to the new SpotifyWebAPI introduced ",Object(b.b)("a",Object(r.a)({parentName:"p"},{href:"https://developer.spotify.com/web-api/"}),"here"),".\nWith it, you can search for Tracks/Albums/Artists and also get User-based information.\nIt's also possible to create new playlists and add tracks to it."),Object(b.b)("h2",{id:"first-steps"},"First steps"),Object(b.b)("h3",{id:"imports"},"Imports"),Object(b.b)("p",null,"So after you added the API to your project, you may want to add following imports to your files:"),Object(b.b)("pre",null,Object(b.b)("code",Object(r.a)({parentName:"pre"},{className:"language-csharp"}),"using SpotifyAPI.Web; //Base Namespace\nusing SpotifyAPI.Web.Enums; //Enums\nusing SpotifyAPI.Web.Models; //Models for the JSON-responses\n")),Object(b.b)("h3",{id:"basic-usage"},"Basic-Usage"),Object(b.b)("p",null,"Now you can actually start doing calls to the SpotifyAPI, just create a new Instance of SpotifyWebAPI:"),Object(b.b)("pre",null,Object(b.b)("code",Object(r.a)({parentName:"pre"},{className:"language-csharp"}),'private static SpotifyWebAPI _spotify;\n\npublic static void Main(String[] args)\n{\n _spotify = new SpotifyWebAPI()\n {\n AccessToken = "XXXXXXXXXXXX",\n TokenType = "Bearer"\n }\n FullTrack track = _spotify.GetTrack("3Hvu1pq89D4R0lyPBoujSv");\n Console.WriteLine(track.Name); //Yeay! We just printed a tracks name.\n}\n')),Object(b.b)("p",null,"You may note that we used ",Object(b.b)("inlineCode",{parentName:"p"},"AccessToken")," and ",Object(b.b)("inlineCode",{parentName:"p"},"TokenType"),". Spotify does not allow un-authorized access to their API. You will need to implement one of the auth flows. Luckily, ",Object(b.b)("inlineCode",{parentName:"p"},"SpotifyAPI.Web.Auth")," exists for this reason. A simple way to receive a ",Object(b.b)("inlineCode",{parentName:"p"},"AccessToken")," is via ",Object(b.b)("inlineCode",{parentName:"p"},"CredentialAuth"),":"),Object(b.b)("