Communicating with a server via API Calls and/or JSON

Can you communicate with a server from within a game?

I don't know about any limitations in MV, but if there is none, you should be able to read data from an external server that delivers JSON. Could you also do API calls as well?
Yes, you could, but you would need to add the code yourself.


Moving to Learning JavaScript
Yes you can, you can use something like backbone to hook up ajax calls to a third party server. 
DarknessFalls > But where to make those calls? Everything is ready and works in a normal HTML page, but it seems like I cannot find where to proceed. I can of course make anything I want to appear in the index.html DOM, but then..? How can I make RPG Maker MV to read the value or innerHTML of that DOM element (and vice-versa, needs to be bi-directional)? I can pay you for that.
You should be able to read value from DOM by this code:

var getdom = document.getElementById('your-id');However, if you're interested in reading JSON file, feel free to adapt from this code in DataManager.loadDataFile 😀

Code:
DataManager.loadDataFile = function(name, src) {    var xhr = new XMLHttpRequest();    var url = 'data/' + src;    xhr.open('GET', url);    xhr.overrideMimeType('application/json');    xhr.onload = function() {        if (xhr.status < 400) {            window[name] = JSON.parse(xhr.responseText);            DataManager.onLoad(window[name]);        }    };    xhr.onerror = function() {        DataManager._errorUrl = DataManager._errorUrl || url;    };    window[name] = null;    xhr.send();};
you can use backbone to communicate with a server, Im doing it for a custom script
I recommend using superagent if you can find a minified/browserified version (quick google search doesn't turn up anything though)

https://github.com/visionmedia/superagent

Original thread: https://forums.rpgmakerweb.com/threads/communicating-with-a-server-via-api-calls-and-or-json.46290/