热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

什么是API接口?给大家举例说明

Api接口也就是所谓的应用程序接口,api接口的全称是ApplicationProgramInterface,通过API接口可以实现计算机软件之间的相互

       Api接口也就是所谓的应用程序接口,api接口的全称是Application Program Interface,通过API接口可以实现计算机软件之间的相互通信,开发人员可以通过API接口程序开发应用程序,可以减少编写无用程序,减轻编程任务,API 同时也是一种中间件,为各种不同平台提供数据共享。根据单个或分布式平台上不同软件应用程序间的数据共享性能。

  举个例子来说明,就是当你在购物平台上买东西付款之后,商家选择某一快递公司发货,然后你就可以在购物平台上面查看快递的实时进程。购物平台和快递公司都是独立的公司,为什么能够在购物平台看到快递公司的信息呢,这里就是用到了API,当你在查看快递信息的时候,购物平台的内部系统也开始运作,购物平台通过快递公司提供的API接口,可以实时调取快递信息到网站上。除此之外,你还可以在搜索引擎上输入快递的订单号进行查询,只要是通过快递公司的允许别的公司都可以通过快递公司的API接口调取到快递信息。

  而API接口平台大多都是用来开发新的应用软件的,这样可以有效的避免因为程序员编写的接口有问题,导致拖延时间,无法在应有的时间内完成软件的编写,但是在有了api接口程序之后,能够帮助开发者提升开发效率,可以大大的缓解这种情况的发生,可以让开发人员更加有效的完成软件的开发工作。能以一种简单的方式实现App里的某个服务已经成为开发者们最好的选择。

       我们以淘宝API接口为例,下图为测试页面展示:

      通过接口可以快速的获取我们想要的信息。

      测试地址:https://console.open.onebound.cn/console/index.php?i=hardy 注册可以赠送测试,亲测有效

{"items": {"page": "1","real_total_results": 1000,"total_results": 1000,"page_size": 40,"pagecount": 50,"data_from": "hid","item": [{"title": "优衣库 女装 棉质T恤(长袖) 430273 UNIQLO","pic_url": "https://img.alicdn.com/imgextra/i1/196993935/O1CN019g5Rmc1ewH9VOcioZ_!!196993935-0-picasso.jpg","promotion_price": "79.00","price": "79.00","sales": 0,"num_iid": "627543382638","seller_nick": "优衣库官方旗舰店","seller_id": "0","detail_url": "https://item.taobao.com/item.htm?id=627543382638","data_f": null,"data_update": "2021-10-18 04:05:29"},{"title": "Data Zara新款 女装 垂褶直筒裙 08000878800","pic_url": "//img.alicdn.com/imgextra/i1/2209090117041/O1CN01psHm3u21spO3HTo4R_!!2209090117041.jpg","promotion_price": "179.00","price": "299.00","sales": 22,"num_iid": "649663627852","seller_nick": "雨雨宝代购","seller_id": "2209090117041","detail_url": "https://item.taobao.com/item.htm?id=649663627852","data_f": null,"data_update": "2021-10-16 12:45:43"},{"title": "Data Zara早秋新款 女装 黑色纹理西装外套 08542182800","pic_url": "//img.alicdn.com/imgextra/i3/2209090117041/O1CN01lEcwMt21spP1byqA5_!!2209090117041.jpg","promotion_price": "199.00","price": "499.00","sales": 5,"num_iid": "654806505193","seller_nick": "雨雨宝代购","seller_id": "2209090117041","detail_url": "https://item.taobao.com/item.htm?id=654806505193","data_f": null,"data_update": "2021-10-16 12:49:30"},{"title": "Data Zara早秋新款 TRF 女装 阔腿牛仔裤 06688224800","pic_url": "//img.alicdn.com/imgextra/i3/2209090117041/O1CN01IAqDBX21spOmbq1p6_!!2209090117041.jpg","promotion_price": "189.00","price": "299.00","sales": 13,"num_iid": "653090373325","seller_nick": "雨雨宝代购","seller_id": "2209090117041","detail_url": "https://item.taobao.com/item.htm?id=653090373325","data_f": null,"data_update": "2021-10-16 12:56:19"},{"title": "Data Zara早秋新款 女装 带垫肩修身西装外套 08526707706","pic_url": "//img.alicdn.com/imgextra/i4/2209090117041/O1CN01B7oCY521spP2QRdwS_!!2209090117041.jpg","promotion_price": "189.00","price": "699.00","sales": 2,"num_iid": "655250722892","seller_nick": "雨雨宝代购","seller_id": "2209090117041","detail_url": "https://item.taobao.com/item.htm?id=655250722892","data_f": null,"data_update": "2021-10-16 12:58:46"},{"title": "【返场可用券】女装 乔其纱荷叶边领衬衫(优衣库云朵衫)429418","pic_url": "https://img.alicdn.com/imgextra/i1/196993935/O1CN01ih9Nbv1ewH9egqnRD_!!196993935-0-picasso.jpg","promotion_price": "99.00","price": "99.00","sales": 0,"num_iid": "630637243596","seller_nick": "优衣库官方旗舰店","seller_id": "0","detail_url": "https://item.taobao.com/item.htm?id=630637243596","data_f": "ez","data_update": "2021-10-26 01:29:59"},{"title": "女装 法兰绒松紧长裤 419869 优衣库UNIQLO","pic_url": "https://img.alicdn.com/imgextra/i1/196993935/O1CN01M954io1ewH64qS6P1_!!0-item_pic.jpg","promotion_price": "79.00","price": "79.00","sales": 0,"num_iid": "603915062201","seller_nick": "优衣库官方旗舰店","seller_id": "0","detail_url": "https://item.taobao.com/item.htm?id=603915062201","data_f": null,"data_update": "2021-10-17 03:34:41"},{"title": "优衣库 女装/情侣装 便携式防紫外线连帽外套(防晒衣) 419912","pic_url": "https://img.alicdn.com/imgextra/i1/196993935/O1CN016XGJ8T1ewH9TUKFm0_!!196993935-0-picasso.jpg","promotion_price": "99.00","price": "99.00","sales": 0,"num_iid": "594452029554","seller_nick": "优衣库官方旗舰店","seller_id": "0","detail_url": "https://item.taobao.com/item.htm?id=594452029554","data_f": null,"data_update": "2021-10-17 06:55:43"},{"title": "KASLEAD 新款 女装 欧美风圆领拼接长袖针织衫上衣 04331116330","pic_url": "https://gw.alicdn.com/imgextra/O1CN011E3pb91uxDtCdDWpt_!!704346103.jpg","promotion_price": "59.00","price": "59.00","sales": 0,"num_iid": "652238928321","seller_nick": "mdxiaozhi","seller_id": "704346103","detail_url": "https://item.taobao.com/item.htm?id=652238928321","data_f": "Ha","data_update": "2022-09-07 19:44:46"},{"title": "优衣库 男装/女装 折叠伞 420562 UNIQLO","pic_url": "https://img.alicdn.com/imgextra/i3/O1CN01SAWSAR1ewH8EvemW2_!!0-item_pic.jpg","promotion_price": "79.00","price": "79.00","sales": 200,"num_iid": "595863242238","seller_nick": null,"seller_id": "0","detail_url": "https://item.taobao.com/item.htm?id=595863242238","data_f": null,"data_update": "2021-10-19 19:14:20"},{"title": "KASLEAD 新款 女装 欧美风叠层装饰质感格子衬衫上衣 05216051712","pic_url": "https://img.alicdn.com/imgextra/i2/704346103/O1CN01kRb29o1uxDrIrk6SY_!!704346103.jpg","promotion_price": "49.00","price": "49.00","sales": 0,"num_iid": "640754369310","seller_nick": "mdxiaozhi","seller_id": "0","detail_url": "https://item.taobao.com/item.htm?id=640754369310","data_f": null,"data_update": "2021-10-17 14:20:24"},{"title": "优衣库 女装 法国麻衬衫(长袖) 424658 UNIQLO","pic_url": "https://img.alicdn.com/imgextra/i1/196993935/O1CN01LHiAl11ewH7ye71oD_!!0-item_pic.jpg","promotion_price": "99.00","price": "99.00","sales": 0,"num_iid": "622660418741","seller_nick": "优衣库官方旗舰店","seller_id": "0","detail_url": "https://item.taobao.com/item.htm?id=622660418741","data_f": null,"data_update": "2021-10-17 16:48:44"},{"title": "ZARA 新款 女装 提花修身通勤西装外套 08474464733","pic_url": "https://img.alicdn.com/imgextra/i3/2228361831/O1CN01IB8Iq81POduQH4scG_!!2228361831.jpg","promotion_price": "499.00","price": "499.00","sales": 0,"num_iid": "653812517886","seller_nick": "zara官方旗舰店","seller_id": "0","detail_url": "https://item.taobao.com/item.htm?id=653812517886","data_f": "ez","data_update": "2021-12-02 23:35:01"},{"title": "【漫囧】鬼灭之刃 灶门祢豆子 圣诞 睡衣 女装 cos服装 现货","pic_url": "https://gw.alicdn.com/imgextra/O1CN01PLZlPq2BldPahjqiw_!!2940718379.jpg","promotion_price": "88.00","price": "176.00","sales": 20000,"num_iid": "607612962557","seller_nick": "漫囧旗舰店","seller_id": "2940718379","detail_url": "https://item.taobao.com/item.htm?id=607612962557","data_f": "Ha","data_update": "2022-09-07 17:28:04"},{"title": "ZARA 新款 TRF 女装 丝缎质感印花连衣裙 08342310800","pic_url": "https://img.alicdn.com/imgextra/i4/2228361831/O1CN01wKIehO1POduMBOcMj_!!2228361831.jpg","promotion_price": "259.00","price": "259.00","sales": 0,"num_iid": "652476230338","seller_nick": "zara官方旗舰店","seller_id": "0","detail_url": "https://item.taobao.com/item.htm?id=652476230338","data_f": "ez","data_update": "2021-11-16 21:18:07"},{"title": "优衣库 女装 法兰绒格子半开领上衣(长袖) 421610 UNIQLO","pic_url": "https://img.alicdn.com/imgextra/i4/196993935/O1CN01wvXLxU1ewH8VhuJiZ_!!0-item_pic.jpg","promotion_price": "59.00","price": "59.00","sales": 0,"num_iid": "608838018646","seller_nick": "优衣库官方旗舰店","seller_id": "0","detail_url": "https://item.taobao.com/item.htm?id=608838018646","data_f": null,"data_update": "2021-10-17 19:41:06"},{"title": "优衣库 女装 罗纹圆领T恤(短袖) 430872 UNIQLO","pic_url": "https://img.alicdn.com/imgextra/i1/196993935/O1CN01BZiXdR1ewH9kDhn4Y_!!196993935-0-picasso.jpg","promotion_price": "79.00","price": "79.00","sales": 0,"num_iid": "624874625258","seller_nick": "优衣库官方旗舰店","seller_id": "0","detail_url": "https://item.taobao.com/item.htm?id=624874625258","data_f": "ez","data_update": "2021-11-02 02:41:32"},{"title": "KASLEAD 新款 女装 欧美风刺绣性感露背吊带连体裤 07200221406","pic_url": "//img.alicdn.com/imgextra/i2/704346103/O1CN01XThtdf1uxDsR7e283_!!704346103.jpg","promotion_price": "59.00","price": "59.00","sales": 0,"num_iid": "648195301543","seller_nick": "凯诗兰迪欧美女装","seller_id": "704346103","detail_url": "https://item.taobao.com/item.htm?id=648195301543","data_f": "Ha","data_update": "2022-01-06 22:59:32"},{"title": "KASLEAD 新款 女装 欧美风宽松条纹府绸衬衫休闲短裤 03510023060","pic_url": "https://gw.alicdn.com/imgextra/O1CN01lUKJAp1uxDshfacGw_!!704346103.jpg","promotion_price": "39.00","price": "39.00","sales": 0,"num_iid": "651088595653","seller_nick": "mdxiaozhi","seller_id": "704346103","detail_url": "https://item.taobao.com/item.htm?id=651088595653","data_f": "Ha","data_update": "2022-09-07 22:25:25"},{"title": "KASLEAD 新款 女装 欧美风扎染短上衣印花休闲短裤 03564077046","pic_url": "//img.alicdn.com/imgextra/i4/704346103/O1CN01a6aJfJ1uxDrXP3bvb_!!704346103.jpg","promotion_price": "34.00","price": "34.00","sales": 180000,"num_iid": "641748672221","seller_nick": "mdxiaozhi","seller_id": "704346103","detail_url": "https://item.taobao.com/item.htm?id=641748672221","data_f": "xdl","data_update": "2022-07-02 20:01:01"},{"title": "优衣库 女装 高腰宽腿长裤 425341 UNIQLO","pic_url": "https://img.alicdn.com/imgextra/i3/196993935/O1CN01zRQHU71ewH916PuaA_!!0-item_pic.jpg","promotion_price": "79.00","price": "79.00","sales": 0,"num_iid": "616591228867","seller_nick": "优衣库官方旗舰店","seller_id": "0","detail_url": "https://item.taobao.com/item.htm?id=616591228867","data_f": null,"data_update": "2021-10-17 22:57:39"},{"title": "KASLEAD 新款 女装 欧美风洋气v领镂空花边针织马甲背心马夹外套","pic_url": "//img.alicdn.com/imgextra/i4/704346103/O1CN01G5elHv1uxDqkYWBGJ_!!704346103.jpg","promotion_price": "32.00","price": "32.00","sales": 1,"num_iid": "638301796004","seller_nick": "mdxiaozhi","seller_id": "704346103","detail_url": "https://item.taobao.com/item.htm?id=638301796004","data_f": "jcs","data_update": "2021-12-03 23:38:39"},{"title": "犬夜叉 桔梗 巫女服 和服 cosplay服装 全套 动漫 衣服 女装 假发","pic_url": "https://gw.alicdn.com/imgextra/TB1DlV8KXXXXXahXFXXXXXXXXXX_!!0-item_pic.jpg","promotion_price": "83.00","price": "98.00","sales": 0,"num_iid": "522756317480","seller_nick": "筷子闯马头","seller_id": "2644559082","detail_url": "https://item.taobao.com/item.htm?id=522756317480","data_f": "Ha","data_update": "2022-09-07 15:33:10"},{"title": "优衣库聪明裤 女装 弹力九分裤 (通勤西装裤长裤) 445296/439247","pic_url": "https://gw.alicdn.com/imgextra/O1CN01ehnmuR1ewHIOuqNzu_!!196993935.jpg","promotion_price": "199.00","price": "199.00","sales": 45850000,"num_iid": "632021377346","seller_nick": "优衣库官方旗舰店","seller_id": "196993935","detail_url": "https://item.taobao.com/item.htm?id=632021377346","data_f": "Ha","data_update": "2022-09-07 18:33:45"},{"title": "优衣库 女装 EZY弹力九分裤 425344 UNIQLO","pic_url": "https://img.alicdn.com/imgextra/i4/196993935/O1CN012q5kQM1ewHAH54CH0_!!0-item_pic.jpg","promotion_price": "79.00","price": "79.00","sales": 0,"num_iid": "610194012059","seller_nick": "优衣库官方旗舰店","seller_id": "0","detail_url": "https://item.taobao.com/item.htm?id=610194012059","data_f": null,"data_update": "2021-10-19 18:12:26"},{"title": "ZARA 冬季新款 女装 仿皮短连衣裙 02969313717","pic_url": "//img.alicdn.com/imgextra/i3/2228361831/O1CN0180zndx1POdv2c39Ka_!!2228361831.jpg","promotion_price": "399.00","price": "399.00","sales": 2,"num_iid": "658170840643","seller_nick": "zara官方旗舰店","seller_id": "2228361831","detail_url": "https://item.taobao.com/item.htm?id=658170840643","data_f": "jcs","data_update": "2021-11-27 18:55:09"},{"title": "ZARA新款 TRF 女装 中腰及踝喇叭牛仔裤 03643012800","pic_url": "http://img.alicdn.com/imgextra/i1/2228361831/O1CN01pt0rSa1POdgxSXH9K_!!2228361831.jpg","promotion_price": "199.00","price": "199.00","sales": 0,"num_iid": "586777007872","seller_nick": "zara官方旗舰店","seller_id": "0","detail_url": "https://item.taobao.com/item.htm?id=586777007872","data_f": "ez","data_update": "2021-11-04 03:09:58"},{"title": "优衣库 女装 弹力裙(半身裙通勤职业) 439263 UNIQLO","pic_url": "https://gw.alicdn.com/imgextra/O1CN01YuygUy1ewHITXQj5b_!!0-item_pic.jpg","promotion_price": "199.00","price": "199.00","sales": 620000,"num_iid": "644929660920","seller_nick": "优衣库官方旗舰店","seller_id": "196993935","detail_url": "https://item.taobao.com/item.htm?id=644929660920","data_f": "Ha","data_update": "2022-09-07 19:15:48"},{"title": "【SEN】BJD/SD/DD娃娃/娃衣/女装/COS/SABER/日常服/睡衣/泳装","pic_url": "https://gw.alicdn.com/imgextra/T1FcbiFnpbXXXXXXXX_!!0-item_pic.jpg","promotion_price": "48.00","price": "48.00","sales": 0,"num_iid": "35148932222","seller_nick": "月下西桥","seller_id": "69023553","detail_url": "https://item.taobao.com/item.htm?id=35148932222","data_f": "Ha","data_update": "2022-09-07 20:05:15"},{"title": "【设计师合作款】女装 牛仔休闲短裤(水洗产品) 425864 优衣库","pic_url": "https://img.alicdn.com/imgextra/i2/196993935/O1CN01AE2Yhx1ewH73G3Pak_!!0-item_pic.jpg","promotion_price": "199.00","price": "199.00","sales": 0,"num_iid": "611042720840","seller_nick": "优衣库官方旗舰店","seller_id": "0","detail_url": "https://item.taobao.com/item.htm?id=611042720840","data_f": "ez","data_update": "2021-10-29 13:02:12"},{"title": "ZARA 新款 TRF 女装 仿皮短裤 07901291706","pic_url": "https://img.alicdn.com/imgextra/i4/2228361831/O1CN01KMYvsN1POdqG24dTO_!!2228361831.jpg","promotion_price": "199.00","price": "199.00","sales": 0,"num_iid": "630202744993","seller_nick": "zara官方旗舰店","seller_id": "0","detail_url": "https://item.taobao.com/item.htm?id=630202744993","data_f": null,"data_update": "2021-10-18 14:33:45"},{"title": "ZARA 秋季新款 女装 不对称披肩针织衫 06873108712","pic_url": "https://img.alicdn.com/imgextra/i4/2228361831/O1CN01O23T5h1POdtxSkI7M_!!0-item_pic.jpg","promotion_price": "399.00","price": "399.00","sales": 0,"num_iid": "655218679409","seller_nick": "zara官方旗舰店","seller_id": "0","detail_url": "https://item.taobao.com/item.htm?id=655218679409","data_f": null,"data_update": "2021-10-18 14:41:44"},{"title": "女装 全棉休闲T恤(法式袖) 424867 优衣库UNIQLO","pic_url": "https://img.alicdn.com/imgextra/i3/196993935/O1CN01GAZSQ31ewH7M4OlDG_!!0-item_pic.jpg","promotion_price": "79.00","price": "79.00","sales": 0,"num_iid": "616426236737","seller_nick": "优衣库官方旗舰店","seller_id": "0","detail_url": "https://item.taobao.com/item.htm?id=616426236737","data_f": null,"data_update": "2021-10-18 15:19:47"},{"title": "优衣库 男装/女装/情侣装 可机洗宽松V领背心 443918/439928","pic_url": "https://img.alicdn.com/bao/uploaded/i4/196993935/O1CN01i1iI4T1ewHDzL13Xz_!!0-item_pic.jpg","promotion_price": "149.00","price": "149.00","sales": 2000,"num_iid": "655292337972","seller_nick": "","seller_id": "0","detail_url": "https://item.taobao.com/item.htm?id=655292337972","data_f": null,"data_update": "2021-10-18 20:57:15"},{"title": "ZARA 秋季新款 女装 条纹针织衫 06254106104","pic_url": "https://img.alicdn.com/imgextra/i3/O1CN019HniLR1POdttrbjkz_!!2228361831.jpg","promotion_price": "299.00","price": "299.00","sales": 0,"num_iid": "655991127748","seller_nick": null,"seller_id": "0","detail_url": "https://item.taobao.com/item.htm?id=655991127748","data_f": null,"data_update": "2021-10-18 15:29:01"},{"title": "优衣库 女装 羊毛混纺双面呢大衣 432068 UNIQLO","pic_url": "https://img.alicdn.com/imgextra/i1/196993935/O1CN01M9cPmi1ewH8i88xam_!!0-item_pic.jpg","promotion_price": "899.00","price": "899.00","sales": 0,"num_iid": "624226446897","seller_nick": "优衣库官方旗舰店","seller_id": "0","detail_url": "https://item.taobao.com/item.htm?id=624226446897","data_f": null,"data_update": "2021-10-18 15:57:03"},{"title": "ZARA 新款 女装 粗横棱纹织物裙子 04886458800","pic_url": "https://img.alicdn.com/imgextra/i3/2228361831/O1CN01Xk7a8l1POdp7xqsc7_!!2228361831.jpg","promotion_price": "159.00","price": "159.00","sales": 0,"num_iid": "628539236611","seller_nick": "zara官方旗舰店","seller_id": "0","detail_url": "https://item.taobao.com/item.htm?id=628539236611","data_f": null,"data_update": "2021-10-18 15:58:15"},{"title": "1G4K201高端冬装 女装 双面穿 豹纹羽绒服吊牌5390","pic_url": "https://gw.alicdn.com/imgextra/O1CN01M3rzQd2C4rpMbrRwD_!!36778421.jpg","promotion_price": "1900.00","price": "1900.00","sales": 0,"num_iid": "602752455766","seller_nick": "杨家儒帅","seller_id": "36778421","detail_url": "https://item.taobao.com/item.htm?id=602752455766","data_f": "Ha","data_update": "2022-09-07 17:20:19"},{"title": "KASLEAD 新款 女装 欧美风腰带配饰高腰裤多色 08412691300","pic_url": "https://gw.alicdn.com/imgextra/O1CN0173Ye691uxDhh4pang_!!704346103.jpg","promotion_price": "59.00","price": "59.00","sales": 130000,"num_iid": "591566263894","seller_nick": "mdxiaozhi","seller_id": "704346103","detail_url": "https://item.taobao.com/item.htm?id=591566263894","data_f": "Ha","data_update": "2022-09-07 16:59:09"},{"title": "优衣库 女装 高弹力运动短裤 422814 UNIQLO","pic_url": "https://img.alicdn.com/imgextra/i2/196993935/O1CN0185QAbL1ewHCG3AgcU_!!0-item_pic.jpg","promotion_price": "59.00","price": "59.00","sales": 0,"num_iid": "611580730319","seller_nick": "优衣库官方旗舰店","seller_id": "0","detail_url": "https://item.taobao.com/item.htm?id=611580730319","data_f": null,"data_update": "2021-10-18 17:53:11"}],"item_weight_update": 0},"error_code": "0000","reason": "ok","secache": "a8881ed5637e3c7e84f03acdc86be64f","secache_time": 1663122471,"secache_date": "2022-09-14 10:27:51","translate_status": "","translate_time": 0,"language": {"default_lang": "cn","current_lang": "cn"},"error": "","cache": 0,"api_info": "today:19 max:10100 all[71=19+17+35];expires:2030-12-31","execution_time": "0.309","server_time": "Beijing/2022-09-14 10:27:51","client_ip": "106.6.39.203","call_args": {"q": "女装","start_price": "0","end_price": "0","page": "1","cat": "0"},"api_type": "taobao","translate_language": "zh-CN","translate_engine": "google_new","server_memory": "5.94MB","request_id": "gw-1.63213c271950d","last_id": "1214832306"
}

 免费获取测试key和secret


推荐阅读
author-avatar
H小气淘淘_238
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有