title: Using cURL with a restricted Mapbox Static Images API
body: <p>So I'm currently working on a project that I hope to have ready for next week.</p>
  <p>I'm working with the Mapbox Static Images API, and I've restricted the API to my domain. It works flawlessly when using the API in a  tag. But I, unfortunately, need it to work with curl instead.</p>
  <p>I've made a new API key that I only use for Static Images. The API only have access to the public scope &quot;STYLES:TILES&quot;. The API key is URL restricted to my domain. I've got no issues with the curl if I don't restrict it.</p>
  <p>I've attached a small snippet of my code below, which returns &quot;message:restricted&quot;.</p>
  <p>Thanks in advance!</p>
  <pre><code>$mapBoxURL = &quot;https://api.mapbox.com/styles/v1/mapbox/streets-v11/static/pin-s+c41c1c(-3,41)/-3,41,12,0/300x200?access_token=myApiKey&quot;;
  
  
  $ch = curl_init ($mapBoxURL);
  
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  
  $raw = curl_exec($ch);
  curl_close ($ch);
  
  var_dump($raw);
  </code></pre>