JSON (JavaScript Object Notation) is a lightweight data-interchange format. The Stackexchange API delivers its data using this format. The tag is meant for questions about reading and interpreting JSON.

learn more… | top users | synonyms

2
votes
2answers
192 views

Import nested JSON file [duplicate]

For a project where I receive JSON messages from a web server I was trying to convert these messages into a format that can be used easily within Mathematica. Because JSON also consists of key-value ...
1
vote
1answer
61 views

How to interpret and extract the information from the JSON (JavaScript Object Notation)? [closed]

How to interpret and extract the information from the JSON (JavaScript Object Notation)? I would extract the information and plot the information graphically. Please advise and comment. Thank you. ...
4
votes
1answer
79 views

How to get sub property from json result?

I'm brand new to Mathematica and I imported a json: data = ImportString["{\"x\":1,\"y\":1}", "json"] and result: ...
3
votes
0answers
30 views

Can JLink return a structured object?

What I want to achieve seems obvious but I cannot figure it out: I need to find a way that when I send an expression to be evaluated from a Java back end to a Mathematica kernel, I can live with it ...
16
votes
3answers
777 views

Export dataset to JSON including Unicode Characters

I'm experiencing a weird issue. Consider a dataset defined like this: dataset = Dataset[{<|"a" -> 1, "b" -> 2|>, <|"a" -> 3, "b" -> 4|>}]; ...
3
votes
1answer
148 views

RawJSON vs JSON format

It has been very recently, since the release of version 10.3.0 I think, that Import/Export and ImportString/ExportString functions accept a format parameter with the value of "RawJSON". The ...
0
votes
0answers
53 views

How to export heterogeneous data to single file?

I want to export structured heterogeneous data (containing images) to some standard file format. The expression to export can contain 3 atomic types: numbers, strings, images, and be nested with 2 ...
7
votes
2answers
5k views

How can I create an empty JSON object?

For creating non-empty object, I use following syntax ExportString[{"key" -> "value"}, "JSON"] (*{"key" : "value"}*) But how can I create an empty object? ...
2
votes
0answers
76 views

Exporting organization of Mathematica's documentation to a JSON file

In this answer, @Vitaliy Kaurov explores and utilizes new Mathematica's functionality WolframLanguageData: ...
1
vote
0answers
166 views

Json response for Nodejs with webMathematica

I am trying to pass RESTful calls from my Nodejs server application to webMathematica. How to do so? I also want to receive the response as JSON.
2
votes
1answer
183 views

Dynamic importing of json file is not refreshing

Running Dynamic[Refresh[Import["foo.json"], UpdateInterval->1]] or json := Import["foo.json"] then ...
0
votes
1answer
63 views

How to Export a mixture distribution to .json file

I would like to export the following mixture distribution mathematica found for my dataset to .json file ...
6
votes
3answers
214 views

How to prevent ExportString from reencoding diacritics when exporting as JSON

I'm not sure if it's a bug with Mathematica or if I'm missing something, but when trying to ExportString a UTF-8 string with diacritics as JSON, it's messing up the ...
2
votes
0answers
81 views

Is there a way to specify which kernel is used to import files (SOLVED)?

Following up on a previous question in which I encountered a memory leak in the JSON importer I have created a SandBox script that will run the Import and analysis on a separate kernel, which be ...
3
votes
1answer
116 views

JSON Expandable/Collapsible Fields with OpenerView

When you have a deeply nested hierarchical JSON structure, tools like JSON Editor Online help a lot to get an overview of the structured data at various levels. In this way you control the ...
6
votes
2answers
139 views

Possible memory leak when importing JSON

Bug introduced in 10.0 and persisting though 10.2.0 This problem that I would like to resolve is how to free memory used Import a file when the file is no longer in use. I have a project in which ...
26
votes
3answers
3k views

Extracting values from nested rules in JSON data

I have been using Mathematica to analyse some data from the StackExchange API. It is conveniently available in JSON form, which Mathematica interprets as replacement rules. However, some of the rules ...
0
votes
0answers
78 views

How can I import JSON object as a nested association? [duplicate]

Still seems difficult to get an understanding of a JSON object imported using ImportSting[str,"JSON"]. Is there anyway convert it to a dataset perhaps, where queries would be easier than the ...
3
votes
2answers
224 views

Why are dictionary keys reordered upon JSON import?

After importing a JSON file, Mathematica changed the order of the fields. For example, I downloaded a sample file from: http://api.openweathermap.org/data/2.5/find?lat=55.5&lon=37.5&cnt=10 I ...
3
votes
2answers
171 views

Format google places JSON output

I'm have some trouble formatting the Output of a 'Import' request. I get this as a return of a google places API request: ...
4
votes
1answer
79 views

JSON export truncates numbers to 6 digits of precision

It seems that in version 10.0.2 and 10.1.0, floating point numbers are truncated to only 6 digits of precision when exporting to JSON. Example: ...
0
votes
0answers
42 views

Mathematca terminates internet connection when window is minimized

I wrote a short program which is collecting (and then plotting) data from internet. When I literally don't see, Mathematica stops collecting data and when I maximize window again, it continues. Can ...
14
votes
1answer
5k views

How to request financial data from Yahoo's YQL and Quandl?

How can I download historical data from Yahoo ? Although Mathematica's FinancialData function uses Yahoo it could be useful to have more control on how to retrieve data from Yahoo's YQL. Edit ...
5
votes
0answers
268 views

Export to JSON format specifically for MongoDB

It is a nice thing that, if you have a data as a list of rules (even nested), Mathematica can export them in JSON format. After generating useful data in Mathematica, Therefore, it seems it ought to ...
1
vote
1answer
154 views

A bug won't let me import JSON files

I have been working on a project and I have been using JSON to build some networks, the code I use is: ...
5
votes
0answers
259 views

ImportString JSON possible bug

My problem is when I catch up some json output of whatever method and process it with ImportString[%, "JSON"], The first time ...
1
vote
0answers
155 views

JSON problem? MMA10, Windows 7 or Linux Mint

I want to test Mathematica 10 to import various data format. In this case, I have a JSON file with the following data and structure: ...
7
votes
1answer
738 views

Efficient JSON parser for Mathematica

Im looking for a efficient way of parsing JSON data in Mathematica. I am having a lot of problems with ImportString because it uses Java, is too slow, and uses too ...
9
votes
1answer
550 views

How to import a large (~50Mb) json file in mathematica

I am trying to import a 46Mb json file into mathematica (which by the way I exported using mathematica) but its failing with the following messages: ...
12
votes
3answers
313 views

Wrong numerical value while exporting to a JSON string

The following code: ExportString[{"a" -> 2000000., "b" -> 0.000001}, "JSON"] Gives the results ...
6
votes
1answer
1k views

Importing specific elements from JSON

I'm having trouble importing JSON in the way I expect, based on my reading of the documentation. The particular issue I'm having is with importing a specific element, or list of elements. From the ...
20
votes
1answer
847 views

xkcd: Geohashing in Mathematica

On May 21, 2008, an xkcd comic proposed a method for creating a random, local meeting place that can't be determined until the day of the meeting. This method is usually used for xkcd fan events, ...
8
votes
2answers
603 views

Exporting held expressions through JSON

Trying to round-trip expressions through JSON, I'm getting unexpected errors for held expressions, and would be grateful for advice or clues. Consider, first, something that works well ...