How to Find The Link for JSON Data of a Certain Website

后端 未结 2 572
没有蜡笔的小新
没有蜡笔的小新 2021-02-02 04:41

I just finished a tutorial on how to develop an android application that retrieves updated posts from a Blog using JSON data.

The link to the JSON data used to retrieve

2条回答
  •  爱一瞬间的悲伤
    2021-02-02 05:05

    The quickest and easiest way is to use google developer tools in Google Chrome.

    1st go to google developer tools. F12 or Ctrl+Shift+I or top right Ellipsis->More Tools->Developer Tools

    2nd Click on the "Network" tab.

    3rd click on the "XHR" sub-tab. XHR(XMLHttpRequest)

    if a site uses json it will be listed under the XHR sub-tab. You can search through the different return objects, select one and use the "preview" sub-sub-tab to view it.

    View JSON

    View JSON URL

    Although the above way is the easiest it is not the most stable way of getting the info you need. Many sites make changes to the return data without any notice. This will probably break your app...

    I think what you are looking for is an API(Application programming interface). Most web APIs return json or xml. You should start by searching for the api documentation for the specific site that you want to get json data from. Example documentation for sites that have public api feeds are github api or youtub api. Many of these will require authentication in order to get the desired json response but the documentation should show you how to do it.

    Using a legitimate web api is the most stable way to go. Meaning your app has less chance of randomly breaking all of the time due to feed changes, url changes... I hope this helps!

提交回复
热议问题