如何查找某个网站的JSON数据链接 [英] How to Find The Link for JSON Data of a Certain Website

查看:629
本文介绍了如何查找某个网站的JSON数据链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚完成了有关如何开发android应用程序的教程,该应用程序使用JSON数据从Blog检索更新的帖子.

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

用于检索帖子的JSON数据的链接是以"/api/get_recent_summary"结尾的博客名称

The link to the JSON data used to retrieve the posts, was the blog name ending with "/api/get_recent_summary"

如何找到不同网站的JSON数据链接?

How can I find the link of the JSON data for different websites?

例如The Time Magazine的网站 http://time.com

For example the website for The Time Magazine http://time.com

推荐答案

最快和最简单的方法是在 Google Chrome 中使用 google开发人员工具.

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

第一个进入 google开发人员工具. F12Ctrl+Shift+Itop right Ellipsis->More Tools->Developer Tools

第二个点击"网络"标签.

第三次,点击" XHR "子标签. XHR(XMLHttpRequest)

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

如果站点使用json,它将在 XHR 子标签下列出.您可以搜索不同的返回对象,选择一个并使用预览"菜单.子子标签进行查看.

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.

查看JSON

查看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...

我认为您正在寻找的是 API (应用程序编程接口).大多数Web API返回 json xml .您应该首先搜索要从中获取json数据的特定站点的api文档.具有公共api提要的站点的示例文档为 github api

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.

使用合法的Web API是最稳定的方法.意味着由于Feed更改,url更改,您的应用程序无时无刻不在出现中断的机会...希望对您有所帮助!

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!

这篇关于如何查找某个网站的JSON数据链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆