Skip to main content
1 of 3

StackExchange API with post body returns Json error

We are calling StackExchange API to get some Stackoverflow forum data for research. When calling the API to get post body, it will return error for some threads, e.g. https://api.stackexchange.com/docs/questions#page=13&pagesize=100&fromdate=2013-09-01&todate=2013-09-02&order=asc&sort=creation&filter=!9ciXf5l7v&site=stackoverflow&run=true (https://api.stackexchange.com/docs/questions#page=13&pagesize=100&fromdate=2013-09-01&todate=2013-09-02&order=asc&sort=creation&filter=!9ciXf5l7v&site=stackoverflow&run=true)

But if we exclude the post body by calling this API, https://api.stackexchange.com/docs/questions#page=13&pagesize=100&fromdate=2013-09-01&todate=2013-09-02&order=asc&sort=creation&filter=default&site=stackoverflow&run=true (https://api.stackexchange.com/docs/questions#page=13&pagesize=100&fromdate=2013-09-01&todate=2013-09-02&order=asc&sort=creation&filter=default&site=stackoverflow&run=true), it works fine.

We suspect it’s because the post body contains some characters like “\0” which makes the returned json invalid.