Questions tagged [json-format]

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.

Filter by
Sorted by
Tagged with
2
votes
0answers
28 views

Import data from a webpage with dynamically generated content

Following the example of this very detailed thread 190177 and others related to the subject, that introduced me to snooping around in the developer's tools, I tried to apply to my case, which is ...
7
votes
0answers
77 views

How to export a notebook to Jupyter?

I would like a tool to convert any Mathematica notebook into a Jupyter labs notebook, preserving as much content as possible (.ipynb files are just special json). Obviously, this would need to ...
4
votes
1answer
131 views

Importing a Part of the JSON

This is JSON I'm trying to work within Mathematica: ...
0
votes
0answers
47 views

How to ImportString “JSON” with Unicode characters? [duplicate]

Update The short answer is that when getting results back from an API into an HTTPResponse object the "Body" property is a post-...
3
votes
0answers
61 views

Slight loss of precision when parsing JSON

Exporting to JSON is working well for me under 11.3. The issue present in previous versions seem to be solved: ...
4
votes
1answer
62 views

How to conditionally escape strings in JSON?

If you JSON export an association with a url, it will espace the forward slashes like this: ...
4
votes
0answers
51 views

Importing and and manipulating large GEOJSON files based on geographic locations

I have large GeoJson data files that I would like to import (i.e. buildings in a city, see image below for data structure) and then "cut out" only the buildings that are within approx. 100 GeoDisks (...
1
vote
1answer
198 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 ...
1
vote
0answers
80 views
0
votes
0answers
82 views

Export & Import Association with Lists and Rationals without ExpressionJSON

Consider following association: ...
3
votes
2answers
112 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: ...
7
votes
1answer
132 views

Problem to import numbers longer than 19-digit with “JSON” or “RawJSON”

Bug introduced in 11.0.1 or earlier and fixed in 12.0. 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 ...
7
votes
2answers
213 views

Map Values in 'nested' association

JSON often returns sort of 'nested' associations like so: ...
6
votes
1answer
57 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
235 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 ...
25
votes
3answers
3k 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
351 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
51 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
1k views

How to parse JSON

please forgive me if this is obvious, but I have some JSON: ...
9
votes
2answers
467 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
291 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
162 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
332 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
73 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
58 views

How to interpreter file into date and json?

I have DateAndJson.txt and want to analyse it. ...
6
votes
1answer
294 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
2k 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
176 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
44 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 ...
6
votes
1answer
592 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
1k 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
76 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
105 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
125 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
244 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
336 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
102 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
334 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
241 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
194 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
631 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
595 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
479 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
671 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
353 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
318 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
440 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
173 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
24k 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? ...