api接口编程_什么是API(应用程序编程接口)?

api接口编程

api接口编程

Application Programming Interface or API is a popular term used in the computing world. API is an interface to access different computing, software, library functions. API defines and creates different access types, functions, parameters, and options to access and use resources or software.

Application Programming InterfaceAPI是计算世界中一个流行的术语。 API是用于访问不同的计算,软件,库功能的接口。 API定义并创建了不同的访问类型,功能,参数和选项,以访问和使用资源或软件。

什么是API(应用程序编程接口)? (What Is API(Application Programming Interface)?)

API exposes different resources like software, library, system, or object to the other entities’ use which is generally a software too. There is no specification for API standard or usage but during years some general rules are accepted.API ensures the interoperability between different computing or software entities too. As software usage is increased today there are a lot of different libraries, systems that provide API. Most of the popular Softwares like operating systems, web services, desktop applications, virtualization software, etc. provide an API.

API将其他资源(例如软件,库,系统或对象)公开给其他实体,而其他实体也通常是软件。 没有关于API标准或用法的规范,但是在过去的几年中,一些通用规则被接受.API还确保了不同计算或软件实体之间的互操作性。 随着当今软件使用量的增加,有许多不同的库,系统提供API。 大多数流行的软件(例如,操作系统,Web服务,桌面应用程序,虚拟化软件等)都提供API。

API用法和类型 (API Usage and Types)

API is provided by different entities with different features, access type, and usage type. Below we have listed some usage examples with the API types.

API由具有不同功能,访问类型和使用类型的不同实体提供。 下面我们列出了一些API类型的用法示例。

库和框架API (Library and Framework API)

Libraries and frameworks are the most popular use case for the API. In order to use libraries and frameworks API is used by default. API makes is very flexible to use the library and framework because it will separate the user interface from the actual implementation. Implementation is generally very complex where usage with API makes is very easy and straightforward.

库和框架是API最受欢迎的用例。 为了使用库和框架,默认情况下使用API​​。 API使库和框架的使用非常灵活,因为它将用户界面与实际实现分开。 通常,实现非常复杂,与API一起使用非常容易和直接。

作业系统API (Operating System API)

Operating systems runs on the computing hardware in order to provide different type of resources to the user-level applications. All of these resources are provided via standardized APIs by the operating systems. For compatibility reasons operating systems provides the APIs with different standards like POSIX, Windows API, etc. POSIX is mainly used for Linux, BSD, and Unix operating systems and distributions and Windows API used by Windows family operating systems.

操作系统在计算硬件上运行,以便向用户级应用程序提供不同类型的资源。 所有这些资源均由操作系统通过标准化API提供。 出于兼容性原因,操作系统为API提供了不同的标准,例如POSIX,Windows API等。POSIX主要用于Linux,BSD和Unix操作系统以及Windows系列操作系统使用的发行版和Windows API。

LEARN MORE  What Is Remote Procedure Call (RPC)?
了解更多什么是远程过程调用(RPC)?

远程API (Remote APIs)

Remote APIs provide access to the remote software, library, or application functions and resources via low-level ways. Remote APIs generally used to call a function, method, or access resource of the remote system. Java Remote Method Invocation is one of the most popular Remote API. Java RMI provides remote access to the Java methods, function, objects via different computers and hosts by using the network.

远程API通过低级方式提供对远程软件,库或应用程序功能和资源的访问。 远程API通常用于调用远程系统的函数,方法或访问资源。 Java远程方法调用是最流行的远程API之一。 Java RMI使用网络通过不同的计算机和主机提供对Java方法,函数,对象的远程访问。

网络API (Web API)

Web API is used to access remote functions by using HTTP or HTTPS protocols and technologies like JSON, JavaScript, PHP, Python, XML, SOAP, etc. Web APIs are heavily used in order to provide access via networks or the internet. A lot of popular services like Twitter, Google, Facebook, Instagram provides web API to access their services for the 3rd party software or application. Rest is the most popular sub-type of the Web API which heavily uses JSON for communication. Web APIs can be used by different platforms, programming languages than the Web API service.

Web API用于通过使用HTTP或HTTPS协议以及JSON,JavaScript,PHP,Python,XML,SOAP等技术来访问远程功能。Web API被大量使用以便通过网络或Internet提供访问。 Twitter,Google,Facebook,Instagram等许多流行的服务都提供Web API来访问其对第三方软件或应用程序的服务。 Rest是Web API中最流行的子类型,它大量使用JSON进行通信。 与Web API服务相比,Web API可以由不同的平台,编程语言使用。

API发布政策 (API Release Policies)

APIs provide access to the resources programmatically for everyone by default. But for security, branding reasons access to the APIs should be restricted. The following 3 main policies are used for release and access APIs.

默认情况下,API通过编程方式为每个人提供对资源的访问。 但是出于安全考虑,出于品牌考虑,应限制对API的访问。 以下3个主要策略用于发布和访问API。

Private API Access is used the APIs created for internal use for the company or application. Only the developer company can access this API.

Private API Access用于为公司或应用程序内部使用而创建的API。 只有开发者公司可以访问此API。

Partner API Access is restricted and available for specific companies or businesses.Third-party access is available but only for the partners. For example, Uber only provides access to its partners to the Uber API.

Partner API Access受到限制,并且仅适用于特定公司或企业。第三方访问仅适用于合作伙伴。 例如,Uber仅允许其合作伙伴访问Uber API。

Public API Access provides access to everyone to the API. There is no restriction about API access but in some cases, some user authentication may required to use. As an example, Microsoft Windows API is public where every operating system user can access. Also, Twitter API is a public API where the user requires user authentication for the accounts.

Public API Access提供对所有人的API访问。 对API访问没有限制,但是在某些情况下,可能需要使用某些用户身份验证。 例如,Microsoft Windows API是公共的,每个操作系统用户都可以访问。 此外,Twitter API是公共API,用户需要对帐户进行用户身份验证。

LEARN MORE  How To Parse JSON with JSON.parse() JavaScript Function?
了解更多信息如何使用JSON.parse()JavaScript函数解析JSON?

API文档 (API Documentation)

APIs provide access to different resources where every system is very different cases. APIs aim for simple access but, in order to use properly, there is a need for documentation. API documentation is essential to use API properly and lower the time and effort required to use API. The API documentation provides the following information.

API提供对不同资源的访问,其中每个系统的情况都非常不同。 API旨在实现简单访问,但是为了正确使用,需要文档。 API文档对于正确使用API​​以及减少使用API​​所需的时间和精力至关重要。 API文档提供以下信息。

  • General Information

    一般信息
  • API Architecture

    API架构
  • API Functions

    API函数
  • API Function Examples

    API函数示例
  • Use Cases

    用例
  • Code Snippets

    代码段

API documentation can be created in different ways but some programming languages and frameworks provide practical ways for documentation. Python provides the “Pydoc” mechanism where the documentation can be put inside the code. Documents about API can be easily generated from the source code in a clean and structured way. Also, Java programming language provides the “Javadoc” mechanism which is very similar to the “Pydoc”.

API文档可以以不同的方式创建,但是某些编程语言和框架提供了实用的文档编制方法。 Python提供了“ Pydoc”机制,可将文档放入代码中。 关于API的文档可以通过干净,结构化的方式轻松地从源代码生成。 而且,Java编程语言提供了与“ Pydoc”非常相似的“ Javadoc”机制。

API的优势 (API Advantages)

API usage provides a lot of advantages.

API的使用提供了很多优势。

  • Easy access to the remote resource or function

    轻松访问远程资源或功能
  • Cross-platform usage of the resources and function

    跨平台使用资源和功能
  • Less error and implementation time for resource and function usage

    减少资源和功能使用的错误和实现时间
  • Fast resource and function usage

    快速使用资源和功能
  • More secure usage of the remote resources and functions

    更安全地使用远程资源和功能

谁创建API?(Who Creates API?)

API is technically created by the developers but from a general point of view different groups can create an API for their software, library, product, or service.

API是由开发人员从技术上创建的,但从一般角度来看,不同的小组可以为其软件,库,产品或服务创建API。

  • Large Tech Companies

    大型科技公司
  • Service Owners

    服务负责人
  • Governments Organizations

    政府组织
  • Software Startups

    软件启动
  • Fan Groups

    粉丝团
  • Individuals

    个人
  • Software Companies

    软件公司
  • Sport Communities

    体育社区
  • Ecommerce Companies

    电子商务公司

API提供了什么?(What Is Provided with API?)

API provides easy access to different resources. An API may provide the following resources which vary differently.

API提供了对不同资源的轻松访问。 API可能会提供以下资源,这些资源会有所不同。

  • Login Actions

    登录动作
  • List Of Users

    用户清单
  • List Of Products

    产品清单
  • List Of Tweets

    推文列表
  • Deleting Tweet Action

    删除推文动作
  • Return Images

    返回图片
  • Provide Song Lyrics

    提供歌曲歌词
  • Provide Web Page Parts or Contents

    提供网页部分或内容
  • Provide Latest Current Exchange Rates

    提供最新的当前汇率
  • Start A Virtual Machine On The Cloud

    在云上启动虚拟机
  • Make A Payment

    进行付款
LEARN MORE  What Is CGI (Common Gateway Interface)?
了解更多什么是CGI(通用网关接口)?

API技术 (API Technologies)

In order to create an API, there is some need for helper technologies. These API technologies make API creation and usage more fast and reliable.

为了创建API,需要一些辅助技术。 这些API技术使API的创建和使用更加快速可靠。

JSON is one of the most popular API technology and data exchange format. JSON is used to exchange data in an easy to read and parse format. Also, the JSON format is supported by all popular programming languages and frameworks.

JSON是最流行的API技术和数据交换格式之一。 JSON用于以易于阅读和解析的格式交换数据。 此外,所有流行的编程语言和框架都支持JSON格式。

SOAP is another popular data exchange format that is more complex than JSON. SOAP is mainly used for enterprise-level applications do define the structure of data format and exchange.

SOAP是另一种流行的数据交换格式,它比JSON更复杂。 SOAP主要用于为企业级应用程序做定义数据格式和交换的结构。

REST is a web-based technology where the data is transferred by using HTTP/HTTPS protocols without any restriction and block.

REST是一种基于Web的技术,其中使用HTTP / HTTPS协议传输数据而没有任何限制和阻止。

流行的API (Popular APIs)

Today IT mainly relies on using API. Even making web search Google uses different APIs to accomplish searches. Below we will list some of the popular APIs.

如今,IT主要依靠使用API​​。 即使进行网络搜索,Google也会使用不同的API来完成搜索。 下面我们将列出一些流行的API。

Google Maps API provides access to the Google Map resources like maps, locations, businesses, and embeds this information into the other applications easily.

Google Maps API提供对Google Map资源(如地图,位置,商家)的访问,并将此信息轻松嵌入到其他应用程序中。

YouTube API provides an integrated YouTube platform with different applications and web sites which provide information like Analytics, Data, Live Streaming, Player services.

YouTube API提供了一个集成的YouTube平台,其中包含不同的应用程序和网站,这些网站提供了Google Analytics(分析),数据,实时流媒体,播放器服务等信息。

Flickr API provides access to the Flickr photo library and easily embed different applications.

Flickr API提供对Flickr照片库的访问,并轻松嵌入不同的应用程序。

Twitter API can be used to access Twitter resources like Tweets, Login, Create/Delete/Retweet Tweets. Also, a search can be done on all tweets according to the different terms like the hashtag, date, user, location, etc by using Twitter API.

Twitter API可用于访问Twitter资源,例如Tweets,Login,创建/删除/ Retweet Tweets。 另外,可以使用Twitter API根据不同的术语(例如井号,日期,用户,位置等)对所有tweet进行搜索。

Microsoft Windows API provides operating system resources and functions to the Windows desktop applications. For example, In order to create a window for the application, the Windows API is used.

Microsoft Windows API为Windows桌面应用程序提供了操作系统资源和功能。 例如,为了为应用程序创建一个窗口,使用Windows API。

翻译自: https://www.poftut.com/what-is-api-application-programming-interface/

api接口编程

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值