package api.jisuapi.enterprise; import java.net.URLEncoder; import api.util.HttpUtil; import net.sf.json.JSONArray; import net.sf.json.JSONObject; public class Query { public static final String APPKEY = "your_appkey_here";// 你的appkey public static final String URL = "https://api.jisuapi.com/enterprise2/query"; public static final String company = "杭州网尚科技有限公司";// utf-8 以下三项任选一个 public static final String creditno = ""; public static void Get() throws Exception { String result = null; String url = URL + "?appkey=" + APPKEY + "&company=" + URLEncoder.encode(company, "utf-8"); try { result = HttpUtil.sendGet(url, "utf-8"); JSONObject json = JSONObject.fromObject(result); if (json.getInt("status") != 0) { System.out.println(json.getString("msg")); } else { JSONObject resultarr = json.optJSONObject("result"); JSONObject basic = resultarr.optJSONObject("basic"); String name = basic.getString("name"); String type = basic.getString("type"); String regcapital = basic.getString("regcapital"); String scope = basic.getString("scope"); String startdate = basic.getString("startdate"); String enddate = basic.getString("enddate"); String regorgan = basic.getString("regorgan"); String legalperson = basic.getString("legalperson"); String approvaldate = basic.getString("approvaldate"); String regdate = basic.getString("regdate"); String canceldate = basic.getString("canceldate"); String status = basic.getString("status"); String orgno = basic.getString("orgno"); String creditno = basic.getString("creditno"); String province = basic.getString("province"); String regno = basic.getString("regno"); String regaddress = basic.getString("regaddress"); System.out.println(name + " " + type + " " + regcapital + " " + scope + " " + startdate + " " + enddate + " " + regorgan + " " + legalperson + " " + approvaldate + " " + regdate + " " + canceldate + " " + status + " " + orgno + " " + creditno + " " + province + " " + regno + " " + regaddress); } } catch (Exception e) { e.printStackTrace(); } } }
© 2015-2024 杭州极速互联科技有限公司 版权所有 浙ICP备17047587号-4 浙公网安备33010502005096 增值电信业务经营许可证:浙B2-20190875