Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to use Stacky to grab a question from Stackoverflow, however I always an error. The error thrown is:

JsonReaderException was unhandled - Unexpected character encountered while parsing value: <. Line 1, position 1.

My code is:

var stackClient = new StackyClient("0.9", "<my appid>", Sites.StackOverflow, new UrlClient(), new JsonProtocol());
Question q = stackClient.GetQuestion(4619829);

Anyone any idea?

I've tried referencing both the Newtonsoft.Json assembly that came bundled with the binary download of Stacky and the version in the dependencies folder in the most up to date source version too.

share|improve this question
up vote 5 down vote accepted

Shot in the dark, but I bet "0.9" should be "1.0" in your code.

The API version is currently 1.0, 0.9 was a beta version which has long since been deprecated.

share|improve this answer
This was the problem, I was using a tutorial that must have been written long ago! – AndrewC Jan 6 '11 at 22:13

You should use:

var stackClient = new StackyClient("1.0", "<my appid>", Sites.StackOverflow, new UrlClient(), new JsonProtocol());
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .