Take the 2-minute tour ×
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

I am curious which tools people use for inspecting the JSON results when calling API methods from their browser. I am using Google Chrome, and it displays results such as this for the stats method:

{ "statistics": [ { "total_questions": 682747, "total_unanswered": 105271, "total_answers": 1916396, "total_comments": 2688168, "total_votes": 6739944, "total_badges": 690870, "total_users": 243636, "questions_per_minute": 1.81, "answers_per_minute": 3.81, "badges_per_minute": 1.51, "api_version": { "version": "0.8", "revision": "1.0.1234.5678" } } ] }

Pretty hard to read and interpret those results... what can I use to make testing/exploring easier?

share|improve this question
add comment

7 Answers

up vote 8 down vote accepted

I just use my browser and tack

type=jsontext

onto the end of the request.

This results in plain text output.

share|improve this answer
2  
WOW... didnt know you could do that! Is that part of the Stackapp api? I don't see it documented anywhere... –  Greg Bray May 20 '10 at 23:38
1  
@Greg. It's a supported SA parameter. I'll add it to docs FAQ. –  Joel Potter May 20 '10 at 23:54
add comment

When I go this page in Google Chrome (6.0), it is actually nicely formated. Sure it is still in JSON format, but it is indented and all that fun stuff.

It might just be me though. After spending so much time using print_r() in PHP, I can easily read formats in plain text.

share|improve this answer
    
It is nicely formatted for me, but only if I view the source of that page, not the actual page itself (chrome v5.0.375.28). –  adrianbanks May 20 '10 at 23:29
    
I'm currently using the beta, which is still on v5.0, but I tried the dev release on another machine and it looks much better! I do get the same results on a view source, but that sounds like an extra step... –  Greg Bray May 20 '10 at 23:29
    
@adrian That's odd. I don't have to view the source. I think Chrome, at least my version, auto-detects the application/json content-type and then displays it accordingly. –  Tyler Carter May 20 '10 at 23:29
    
yes - just upgraded to 6.0.408.1 and it does format it directly without having to view the source. –  adrianbanks May 20 '10 at 23:33
add comment

I'll probably just wait until the Chrome beta channel hits version 6.0 to get the pretty formatting that Chacha102 mentioned, but if anyone else is interested I did find that the Pretty JSON Chrome Extension works so long as you add a ?.json or &.json to the end of the URL. Between that and the View source trick that adrianbanks mentioned I think I can manage.

share|improve this answer
add comment

In Firefox, I use this plugin.

It works very well, for the most part.

share|improve this answer
add comment

JsonView is the one I use in Firefox, and when they are ajax requests I look in Firebug at the "Net" tab and it will actually convert the response of JSON requests to an object that you can look at.

share|improve this answer
add comment

Online Jsonviewer is very good online site to format json

share|improve this answer
add comment

Check http://json2table.com

Very good to view arrays and complex structures in Table or Tree.

share|improve this answer
add comment

You must log in to answer this question.

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