Flavio
Flavio

Reputation: 866

Freebase API return raw JSON

The URL https://www.googleapis.com/freebase/v1/topic/en/alps returns a JSON string that is nicely formatted for reading. How can I tell Freebase to return the raw JSON string without all the unnecessary characters?

Upvotes: 0

Views: 106

Answers (2)

Shawn Simister
Shawn Simister

Reputation: 4603

You can make the API request with GZIP enabled which will get rid of ALL the unnecessary bytes.

Accept-Encoding: gzip

You can also use the filter parameter to only return the property values that your app needs.

Upvotes: 1

Tom Morris
Tom Morris

Reputation: 10540

I don't think you can, but it shouldn't make a difference to any JSON parser. The whitespace isn't significant.

Upvotes: 0

Related Questions