public class keywords
{
[JsonProperty(PropertyName = "text")]
public string text { get; set; }
[JsonProperty(PropertyName = "relevance")]
public string relevance { get; set; }
}
public class JsonData
{
[JsonProperty(PropertyName = "status")]
public string status { get; set; }
[JsonProperty(PropertyName = "usage")]
public string usage { get; set; }
[JsonProperty(PropertyName = "url")]
public string url { get; set; }
[JsonProperty(PropertyName = "language")]
public string language { get; set; }
[JsonProperty ("keywords")]
public keywords keyword { get; set; }
}
above are the classes i am using to deserialize the json response being received by calling the alchemy API.
string url = "https://alchemy.p.mashape.com/Text/TextGetRankedKeywords?outputMode=json&text=" + text;
var response = (Unirest.get("https://alchemy.p.mashape.com/Text/TextGetRankedKeywords?outputMode=json&text=" + text)
.header("X-Mashape-Key", "AlZVYH30C9mshLPNM7KiE48aFfTHp1h3A31jsnmVPccxBzW5uB")
.header("Accept", "application/json")
.asJson<JsonData>()
.Body);
var status = response.keyword.text;
var score = response.keyword.relevance;
I am getting this error:
An exception of type 'Newtonsoft.Json.JsonReaderException' occurred in Newtonsoft.Json.dll but was not handled in user code
Additional information: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.