iData are a third party distribution platform that connects service providers with developers. Platform is committed to providing developers with the most comprehensive and convenient services, as well as to help service providers open services to enhance the API call volume.
Currently covers 18 industries at home and abroad, more than 200 mainstream platforms, the most real-time, the most accurate and most comprehensive data API, bit astronauts have been committed to the enterprise, institutions, individual researchers to provide technical support. We use the advanced data acquisition, processing and analysis techniques, with innovative methods to interface the Internet data, so that the data becomes easy to use, to create value, while greatly reducing the development costs.
Login iData
Find the service you want by "Search" or "Category"
Use: Use our provided apikey
(If you do not know how to use, we provide multi-language request examples)
All services at the current stage are free
Users query to the API they need, click into the debug page.
Interface address
In the Debug page, click on the left side of the platform to select, and then select the type, in the right to view the "interface address", and display the service request method.
Request parameter
Depending on the provider is request method type and parameter location, the list of request parameters is different, but roughly similar. Request parameters are specified in the header area parameter and the urlParam parameter.
Header parameter, is the parameters and values into the request of the head, urlParam parameters will be spliced to the address of the api url sent later, the specific meaning of each parameter and requirements, see the parameter list can be.
Request example
On the Debug page, the request example is shown.
Return examples are JSON and other formats, according to the response to the results of data structure, can be resolved.
App key API interface authentication serial number, used to verify the legitimacy of API access, is for each user access to the API authorization and credentials, each API Key uniquely identifies an API user, the user can apply for free access to the corresponding page API key, when the user access to API services, will be their API API as a request parameters passed to the API service.
APIKEY is used to solve the security problems of network interface authentication. Currently only valid for a user is legitimacy.
The current bit astronauts are in a free stage, there will be some security issues, will be followed by https and other security access mechanism.
If there is fraudulent use, then contact the bit astronaut customer service to solve. Customer Service E-mail: iData.market@iData.com
Q1 What is API Area?
API Services deployed in cross area servers. Firstly user enter into api tester page through pressed the button "api test", then he can choose different API Area services depend on the demand.
Q2 Switch API Area
User can choose API Area as the F1, and then copy the service request address through pressed the copy link button.
(F1) API Area switch
Q1 How to switch Htpp(s)
Firstly user enter into api tester page through pressed the button "api test", then he can switch Https or Http service as the F1, and then copy the service request address through pressed the copy link button.
(F1) API Protocol swtich
API (Application Programming Interface) is a pre-defined function, the purpose is to provide applications and developers based on a software or hardware to access a set of routines, without having to access the source code, or understand the internal work Mechanism details.
以下举东方头条API(https://www.idata.cn/product/test/244)作为例子,讲述如何通过pageToken来实现API翻页。(需注意pageToken是一个字符串,可以理解为获取下一页数据的翻页码)。
1.第一次请求(如图1),如果输入的请求参数pageToken为空,默认返回的是第一页数据。如果返回数据中hasNext为true则表示有下一页数据,false表示没有下一页。
2. 把图1中的翻页码PageToken "9223370493470705107",作为pageToken参数值获取下一页结果(如图2), 提交请求或复制链接在浏览器中打开,即可获取当前请求中下一页的数据。
3. 以下以Java作为例子,讲述在同一相同条件下(除pageToken不一样),如何通过翻页获取所有的数据。
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.URL;
import java.nio.charset.Charset;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.PrintWriter;
import java.net.URLConnection;
public class Example {
private static String readAll(Reader rd) throws IOException {
StringBuilder sb = new StringBuilder();
int cp;
while ((cp = rd.read()) != -1) {
sb.append((char) cp);
}
return sb.toString();
}
public static JSONObject postRequestFromUrl(String url, String body) throws IOException, JSONException {
URL realUrl = new URL(url+'&apikey=');
URLConnection conn = realUrl.openConnection();
conn.setDoOutput(true);
conn.setDoInput(true);
PrintWriter out = new PrintWriter(conn.getOutputStream());
out.print(body);
out.flush();
InputStream instream = conn.getInputStream();
try {
BufferedReader rd = new BufferedReader(new InputStreamReader(instream, Charset.forName("UTF-8")));
String jsonText = readAll(rd);
JSONObject json = new JSONObject(jsonText);
return json;
} finally {
instream.close();
}
}
public static void main(String[] args) throws IOException, JSONException {
// 请求示例 url 默认请求参数已经做URL编码
String url = "http://api01.idataapi.cn:8000/news/eastday?kw=nba";
JSONObject json = getRequestFromUrl(url);
System.out.println(json.toString());
while(json.getString('pageToken') != null){
String pageToken = json.getString('pageToken');
url = url + '&pageToken='+pageToken;
json = getRequestFromUrl(url);
System.out.println(json.toString());
}
}
}