Search code examples
c#xamarinrapidapi

How to convert response data from rapidapi.com in c# objects


I have e response from https://rapidapi.com/ and I retrieve data like that in the web:

{1 item
 "data":[1 item
   0:{2 items
   "screen_ID":"76"
   "screen_data":{1 item
   "icoData":{3 items
      "data":[...
      ]3 items
      "tabname":"ongoing"
      "categories":[...
     ]13 items
    }
   }
  }
 ]
}

When I try to convert from JSON to C# object from https://json2csharp.com/ I receive:

Exception: Invalid character after parsing property name. Expected ':' but got: i. Path '', line 1, position 3.

Is there a way to quick create objects with this data ?

rapidapi

I need the "data" content.

rapidapi2


Solution

  • The error message said that the data you received is not a valid json format. It needs a colon after 1item.

    {"1 item":{ 
                 .....  
               }                     
    }
    

    Recheck the renponse that you could get the correct json data.