Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
1answer
59 views

How to parse complex response from SDMX-JSON endpoint in Mathematica

I am trying to use a datasource that has an SDMX-JSON endpoint. I am currently running my tests on Mathematica 10.3.1 running on 64-bit Linux. I started off by familiarising myself with the tools to ...
0
votes
0answers
41 views
3
votes
2answers
93 views

Importing from an API that has non UTF-8 strings

I am new to both Mathematica and API's. I am trying to access a dictionary of player-ids to names from the website datdota.com, but some of them have chinese characters. relevant code: ...
5
votes
0answers
55 views

Problem to import numbers longer that 19-digit with “JSON” and “RawJSON”

MMA 11.0.1.0 (Windows 10, 64-bit) I see that "JSON" import can be buggy (154245), so my question is simple: can the following behaviour be repeated and, if so, is it a bug? (excuses if I've missed ...
7
votes
2answers
198 views

Map Values in 'nested' association

JSON often returns sort of 'nested' associations like so: ...
6
votes
1answer
55 views

Export inserts unwanted characters

I have the following sample JSON file: {"attr1": "Sample with val1"} When I parse it as JSON I get the expected output: ...
1
vote
1answer
162 views

Error: Cannot import data as JSON format, Khan Academy API

Problem context I'm updating my working Mathematica Khan Academy reporting application. Since updating to 11.2 I'm having some errors importing via the Khan Academy API as JSON. Update: This ...
20
votes
3answers
2k views

Who is to blame: parsing UTF8 encoded JSON HTTPResponse fails

Bug introduced in 11.0 or earlier and persists through 11.3 (confirmed by WRI Support but read summary below) Answers summary I think we need a quick summary here to justify keeping bug. Original ...
3
votes
1answer
248 views

Pulling Out Values from JSON Association

Having a bit of trouble pulling a value out of a JSON Association here. I am scraping this website: http://www.msn.com/en-us/money/stockdetails/history/fi-126.1.BY.NYS I want to scrape the closing ...
0
votes
0answers
47 views

Querying the Monero blockchain via JSON-RPC [duplicate]

When querying Monero deamon via JSON-RPC as described in Daemon RPC documentation, via Curl, everithing pass fine : ...
5
votes
1answer
669 views

How to parse JSON

please forgive me if this is obvious, but I have some JSON: ...
9
votes
2answers
449 views

How to extract a value from an XML tree

I am trying to pull out a certain value from an XML tree that I have acquired from a website: ...
4
votes
1answer
183 views

Is it possible to grab all the links at once on a webpage?

I'm working with some webscraping using Mathematica and have run into a question: is it possible to grab all the links on a webpage that scrolls down? The page I am trying to scrape is this: "http://...
1
vote
0answers
140 views

Export number as formatted numeric value, not string

Some related questions include here. Is there a way to format numbers for export in CSV or JSON as numbers - not strings - with a specified number of decimal places and no exponentials? Is output ...
1
vote
2answers
243 views

Using URLFetch/URLExecute to post to an internal server

I've been looking up how to do this for a while and I haven't seen any thorough explanations, just hints. Is there like a secret repository of clearly defined Mathematica code somewhere that I cant ...
4
votes
1answer
67 views

WriteRawJSONString vs ExportString?

What's the difference between Developer`WriteRawJSONString[] and ExportString[]? I see it used a lot but don't see a difference:
0
votes
0answers
52 views

How to interpreter file into date and json?

I have DateAndJson.txt and want to analyse it. ...
5
votes
1answer
254 views

How do I display my weather data in JSON format from Wolfram Mathematica API?

Good day I am trying to display my weather data in a JSON format in order to use it in an iOS app (using swift in Xcode). This is what my code looks like at the moment: ...
5
votes
1answer
1k views

How can I generate a graph from a NetworkX JSON

I have done some network generation and analysis in Python NetworkX. I do most of my visualizations with D3, but for publications I would like to generate some graph plots with Mathematica as well as ...
1
vote
1answer
148 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. <...
3
votes
0answers
42 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 ...
5
votes
1answer
431 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: ...
6
votes
2answers
887 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
70 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 ...
2
votes
0answers
99 views

Exporting organization of Mathematica's documentation to a JSON file

In this answer, @Vitaliy Kaurov explores and utilizes new Mathematica's functionality WolframLanguageData: ...
2
votes
0answers
114 views

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

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 ...
5
votes
1answer
209 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 level-of-...
14
votes
3answers
295 views

Possible memory leak when importing JSON

Bug introduced in 10.0 and persisting though 11.1.1 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 I ...
0
votes
1answer
83 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 ...
3
votes
2answers
312 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
226 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: ...
5
votes
2answers
169 views

JSON export truncates numbers to 6 digits of precision

Update: This problem was fixed in Mathematica 11.3. 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: <...
3
votes
2answers
486 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 ...
9
votes
3answers
478 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
1answer
411 views

Dynamic importing of json file is not refreshing

Running Dynamic[Refresh[Import["foo.json"], UpdateInterval->1]] or json := Import["foo.json"] then ...
6
votes
1answer
601 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 ...
2
votes
1answer
312 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: ...
2
votes
0answers
300 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.
7
votes
0answers
423 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 ...
18
votes
3answers
1k 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|>}]; ...
1
vote
0answers
171 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: ...
9
votes
2answers
18k 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? ...
15
votes
2answers
8k 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 ...
13
votes
2answers
1k 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 ...
10
votes
1answer
797 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: ...
13
votes
3answers
523 views

Wrong numerical value while exporting to a JSON string

The following code: ExportString[{"a" -> 2000000., "b" -> 0.000001}, "JSON"] Gives the results ...
8
votes
1answer
2k 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 doc:...
20
votes
1answer
1k 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, but ...
29
votes
3answers
4k 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 ...