JSONItem is not an array (CurlMBS)

I am having an issue with CurlMBS

Dim c As New CURLMBS
  Dim ebayUrl As String
  ebayUrl = "http://open.api.ebay.com/shopping?callname=GetSingleItem&responseencoding=JSON&appid=[APPID]&siteid=0&version=871&ItemID="+eBayItemID+"&IncludeSelector=TextDescription,ItemSpecifics,Details"
  c.OptionVerbose=true
  c.OptionURL = ebayUrl
  c.CollectDebugData = True
  c.CollectOutputData = True
  
  title=Str(c.Perform)
  //MsgBox c.OutputData
  Dim apiResponseEbay As New JSONItem(c.OutputData)
  Dim resultsEbay As JSONItem = apiResponseEbay.child("Item")
  Dim currentResultEbay As JSONItem=resultsEbay.Value(0) (--------------------This is where my error is.. says "JSONItem is not an array"
  Dim currentPriceEbay As JSONItem = currentResultEbay.Child("Seller")

Can someone please explain what I am doing wrong here? (i have hidden my APPID from the ebayUrl)
I have tried to use HTTPSocket as well, sometimes it returns the json, sometimes it doesnt return anything at all… very strange.

Please check if value property of resultsEbay is really an array. With resultsEbay.Value(0) you access it like an array.

It’s JSON, it should be returned like an array no?

No, it might be an object. The root level of JSON can be either an array or an object.

Have a look at JsonItem.value
http://documentation.xojo.com/index.php/JSONItem.Value

The jsonitem can be either an array or an object.
Your’s in an object, so the call will not work.

Thank you all! I got it working with your suggestions.

For what it’s worth, there’s currently a bug in JSONItem regarding empty arrays, and a bug fix has been submitted for the next IDE release.