Products is not publicly visible when called by API

i have a piece of code that gets the products that i want to display as desired . The problem is that it only shows up when i am logged in .

jQuery.getJSON( "https://wilde-iris.myshopify.com/admin/api/2020-07/products.json?ids=7012259332247,7012276338839,7012278927511,7012263526551,7012268900503", function(data) {
          jQuery.each(data.products, function() {
              console.log("wilde iris");
              jQuery('.content-yml').append('
'+
                  '' +
                  '## '+ this.title +'' + 
                  '£'+this.variants[0].price+'
'+
                  '
');
          });
      }).done(function() {
      })
      .fail(function() {
          jQuery('.content-yml').append('
An error has occurred. Sorry for the inconvenience
');
      });

I tried accessing the URL in get json when not logged in and it gives me an error

{"errors":"[API] Invalid API key or access token (unrecognized login or wrong password)"}

If there is any way please let me know. Thanks for the help !!!