title: Convert JSON to GeoJSON frontend
body: <p>I have json from an open data API that I need to convert into geojson so that it can be displayed as layer on my Mapbox map. I am using Mapbox GL JS library: <a href="https://docs.mapbox.com/mapbox-gl-js/api/" rel="nofollow noreferrer">https://docs.mapbox.com/mapbox-gl-js/api/</a>. Here's the link to the open data json api: <a href="https://data.cityofnewyork.us/resource/64uk-42ks.json" rel="nofollow noreferrer">https://data.cityofnewyork.us/resource/64uk-42ks.json</a>.</p>
  <p>I can successfully fetch the json api and print it to console, but now I need to convert it to a geojson. I know that I can do this entirely frontend because it is open data.</p>
  <p>Here's my code:</p>
  <pre><code>var map = new mapboxgl.Map({
    container: 'map',
    style: 'mapbox://styles/niki12step/ck8q9fgpx00d91ipipual7mrl', // replace this with your style URL
    center: [-73.961581,40.683868],
    zoom: 9.5
  })
  
  var pluto_url = 'https://data.cityofnewyork.us/resource/64uk-42ks.json'
  
  getData();
  
  async function getData () {
     await fetch(pluto_url)
    .then(response =&gt; response.json())
    .then(data =&gt; console.log(data))
  }
  </code></pre>