title: IGDB API v4 searching for a game
body: <p>Hey all the last time I used IGDB was when it was in version 3 and it was easy to search for a game depending on the platform chosen:</p>
  <pre><code>    string url = &quot;https://api-v3.igdb.com/games/?search=&quot; + gameNameHere + 
                   &quot;&amp;fields=name,genres,involved_companies,first_release_date,cover&quot;;
      HttpWebRequest gameRequest = (HttpWebRequest)WebRequest.Create(url);
  </code></pre>
  <p>However, this version 4 is quite compilated since they tie in Twitch Oauth for some reason in order to call the API.</p>
  <p>Besides the Oauth issue I am unable to find a simple search for a game using the <a href="https://github.com/kamranayub/igdb-dotnet" rel="nofollow noreferrer">IGDB-DOTNET</a> wrapper for V4...</p>
  <p><a href="https://i.stack.imgur.com/sFlzd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sFlzd.png" alt="enter image description here" /></a></p>
  <p>Now for this wrapper I start out (like it says on the website) with the following:</p>
  <pre><code>var igdb = new IGDBClient(
    // Found in Twitch Developer portal for your app
    Environment.GetEnvironmentVariable(&quot;IGDB_CLIENT_ID&quot;),
    Environment.GetEnvironmentVariable(&quot;IGDB_CLIENT_SECRET&quot;)
  );
  </code></pre>
  <p>I place both my Client ID and Secret into the proper spots above. Ok, easy enough.</p>
  <p>But now it continues to this - calling it &quot;simple&quot;:</p>
  <pre><code>// Simple fields
  var games = await igdb.QueryAsync&lt;Game&gt;(IGDBClient.Endpoints.Games, 
                         query: &quot;fields id,name; where id = 4;&quot;);
  var game = games.First();
  game.Id; // 4
  game.Name; // Thief
  </code></pre>
  <p>So where did this Thief game ID of 4 come from? How do I search for the game &quot;Thief&quot; and get that ID in order to call the above to get the needed name, cover, artwork, etc...?</p>
  <p>The other 3 examples below that also do not show how to search for a game.</p>
  <p>So is this below what its looking for me to do in order to search?</p>
  <pre><code> var games = await igdb.QueryAsync&lt;Game&gt;(IGDBClient.Endpoints.Games, 
                          query: &quot;search \&quot;Thief\&quot;; fields id,name,cover;&quot;);
  </code></pre>
  <p>If not then how does one do that for V4?</p>