Web API

Screenshot of web API documentation written by NASA

A web API is an application programming interface (API) for either a web server or a web browser. As a web development concept, it can be related to a web application's client side (including any web frameworks being used). A server-side web API consists of one or more publicly exposed endpoints to a defined request–response message system, typically expressed in JSON or XML by means of an HTTP-based web server. A server API (SAPI) is not considered a server-side web API, unless it is publicly accessible by a remote web application.

Client side

A client-side web API is a programmatic interface to extend functionality within a web browser or other HTTP client. Originally these were most commonly in the form of native plug-in browser extensions however most newer ones target standardized JavaScript bindings.

The Mozilla Foundation created their WebAPI specification which is designed to help replace native mobile applications with HTML5 applications.[1][2]

Google created their Native Client architecture which is designed to help replace insecure native plug-ins with secure native sandboxed extensions and applications. They have also made this portable by employing a modified LLVM AOT compiler.

Server side

A server-side web API consists of one or more publicly exposed endpoints to a defined request–response message system, typically expressed in JSON or XML. The web API is exposed most commonly by means of an HTTP-based web server.

Mashups are web applications which combine the use of multiple server-side web APIs.[3][4][5] Webhooks are server-side web APIs that take input as a Uniform Resource Identifier (URI) that is designed to be used like a remote named pipe or a type of callback such that the server acts as a client to dereference the provided URI and trigger an event on another server which handles this event thus providing a type of peer-to-peer IPC.

Endpoints

Endpoints are important aspects of interacting with server-side web APIs, as they specify where resources lie that can be accessed by third party software. Usually the access is via a URI to which HTTP requests are posted, and from which the response is thus expected. Web APIs may be public or private, the latter of which requires an access token.[6]

Endpoints need to be static, otherwise the correct functioning of software that interacts with them cannot be guaranteed. If the location of a resource changes (and with it the endpoint) then previously written software will break, as the required resource can no longer be found at the same place. As API providers still want to update their web APIs, many have introduced a versioning system in the URI that points to an endpoint.

Resources versus services

Web 2.0 Web APIs often use machine-based interactions such as REST and SOAP. RESTful web APIs use HTTP methods to access resources via URL-encoded parameters, and use JSON or XML to transmit data. By contrast, SOAP protocols are standardized by the W3C and mandate the use of XML as the payload format, typically over HTTP. Furthermore, SOAP-based Web APIs use XML validation to ensure structural message integrity, by leveraging the XML schemas provisioned with WSDL documents. A WSDL document accurately defines the XML messages and transport bindings of a Web service.

Documentation

Server-side web APIs are interfaces for the outside world to interact with the business logic. For many companies this internal business logic and the intellectual property associated with it are what distinguishes them from other companies, and potentially what gives them a competitive edge. They do not want this information to be exposed. However, in order to provide a web API of high quality, there needs to be a sufficient level of documentation. One API provider that not only provides documentation, but also links to it in its error messages is Twilio.[7]

However, there are now directories of popular documented server-side web APIs.[8]

Growth and impact

The number of available web APIs has grown consistently over the past years, as businesses realize the growth opportunities associated with running an open platform, that any developer can interact with. ProgrammableWeb tracks over 24000 Web APIs that were available in 2022, up from 105 in 2005.

Web APIs have become ubiquitous. There are few major software applications/services that do not offer some form of web API. One of the most common forms of interacting with these web APIs is via embedding external resources, such as tweets, Facebook comments, YouTube videos, etc. In fact there are very successful companies, such as Disqus, whose main service is to provide embeddable tools, such as a feature-rich comment system.[9] Any website of the TOP 100 Alexa Internet ranked websites uses APIs and/or provides its own APIs, which is a very distinct indicator for the prodigious scale and impact of web APIs as a whole.[10]

As the number of available web APIs has grown, open source tools have been developed to provide more sophisticated search and discovery. APIs.json provides a machine-readable description of an API and its operations, and the related project APIs.io offers a searchable public listing of APIs based on the APIs.json metadata format.[11][12]

Business

Commercial

Many companies and organizations rely heavily on their Web API infrastructure to serve their core business clients. In 2014 Netflix received around 5 billion API requests, most of them within their private API.[13]

Governmental

Many governments collect a lot of data, and some governments are now opening up access to this data. The interfaces through which this data is typically made accessible are web APIs. Web APIs allow for data, such as "budget, public works, crime, legal, and other agency data"[14] to be accessed by any developer in a convenient manner.

Example

An example of a popular web API is the Astronomy Picture of the Day API operated by the American space agency NASA. It is a server-side API used to retrieve photographs of space or other images of interest to astronomers, and metadata about the images.

According to the API documentation,[15] the API has one endpoint:

https://api.nasa.gov/planetary/apod[permanent dead link]

The documentation states that this endpoint accepts GET requests. It requires one piece of information from the user, an API key, and accepts several other optional pieces of information. Such pieces of information are known as parameters. The parameters for this API are written in a format known as a query string, which is separated by a question mark character (?) from the endpoint. An ampersand (&) separates the parameters in the query string from each other. Together, the endpoint and the query string form a URL that determines how the API will respond. This URL is also known as a query or an API call.

In the below example, two parameters are transmitted (or passed) to the API via the query string. The first is the required API key and the second is an optional parameter — the date of the photograph requested.

https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY&date=1996-12-03

Visiting the above URL in a web browser will initiate a GET request, calling the API and showing the user a result, known as a return value or as a return. This API returns JSON, a type of data format intended to be understood by computers, but which is somewhat easy for a human to read as well. In this case, the JSON contains information about a photograph of a white dwarf star:

{
  "date":"1996-12-03",
  "explanation":"Like a butterfly,\r a white dwarf star begins its life\r by casting off a cocoon that enclosed its former self. In this\r analogy, however, the Sun would be\r a caterpillar\r and the ejected shell of gas would become the prettiest of all!\r The above cocoon, the planetary nebula\r designated NGC 2440, contains one of the hottest white dwarf stars known.\r The white dwarf can be seen as the bright dot near the photo's\r center. Our Sun will eventually become a \"white dwarf butterfly\",\r but not for another 5 billion years. The above false color image recently entered the public domain\r and was post-processed by F. Hamilton.\r",
  "hdurl":"https://apod.nasa.gov/apod/image/9612/ngc2440_hst2_big.jpg",
  "media_type":"image",
  "service_version":"v1",
  "title":"Cocoon of a New White Dwarf\r\nCredit:",
  "url":"https://apod.nasa.gov/apod/image/9612/ngc2440_hst2.jpg"
}

The above API return has been reformatted so that names of JSON data items, known as keys, appear at the start of each line. The last of these keys, named url, indicates a URL which points to a photograph:

https://apod.nasa.gov/apod/image/9612/ngc2440_hst2.jpg

Following the above URL, a web browser user would see this photo:

Cocoon of a New White Dwarf

Although this API can be called by an end user with a web browser (as in this example) it is intended to be called automatically by software or by computer programmers while writing software. JSON is intended to be parsed by a computer program, which would extract the URL of the photograph and the other metadata. The resulting photo could be embedded in a website, automatically sent via text message, or used for any other purpose envisioned by a software developer.

See also

References

  1. ^ "Mozilla's WebAPI Wants to Replace Native Apps With HTML5 | Webmonkey | Wired.com". 2013-12-05. Archived from the original on 2013-12-05. Retrieved 2022-01-13.
  2. ^ Mozilla WebAPI Wiki
  3. ^ "What is mash-up? - Definition from WhatIs.com". WhatIs.com. Archived from the original on Apr 24, 2015. Retrieved 2015-11-04.
  4. ^ "Mashup Dashboard". ProgrammableWeb.com. 2009. Archived from the original on May 7, 2021. Retrieved May 29, 2021.
  5. ^ Maximilien, E. Michael; Ranabahu, Ajith; Gomadam, Karthik (Sep–Oct 2008). "An Online Platform for Web APIs and Service Mashups". IEEE Internet Computing. 12 (5): 32–43. doi:10.1109/MIC.2008.92. S2CID 14949046.
  6. ^ "Changes coming in Version 1.1 of the Twitter API".
  7. ^ Mulloy, Brian. Web API Design - Crafting Interfaces that Developers Love (PDF). apigee. p. 11.
  8. ^ "API Directory". ProgrammableWeb. Retrieved 2015-11-03.
  9. ^ "Disqus – The Web's Community of Communities". Disqus. Retrieved 2015-11-04.
  10. ^ "Alexa Top 500 Global Sites". www.alexa.com. Archived from the original on 2015-03-02. Retrieved 2015-11-04.
  11. ^ "APIs.json". apisjson.org. Retrieved 2016-03-14.
  12. ^ "APIs.io - the API search engine". apis.io. Retrieved 2016-03-14.So make it clearly understandable & share your knowledge.
  13. ^ "Top 10 Lessons Learned from the Netflix API - OSCON 2014, Slide 73". 2014-07-24. {{cite journal}}: Cite journal requires |journal= (help)
  14. ^ "Tech Trends 2015, API economy". Deloitte University Press. Archived from the original on 2016-08-15. Retrieved 2015-11-03.
  15. ^ "Astronomy Picture of the Day". NASA APIs.

Further reading

Read other articles:

العلاقات الأوزبكستانية العمانية أوزبكستان سلطنة عمان   أوزبكستان   سلطنة عمان تعديل مصدري - تعديل   العلاقات الأوزبكستانية العمانية هي العلاقات الثنائية التي تجمع بين أوزبكستان وسلطنة عمان.[1][2][3][4][5] مقارنة بين البلدين هذه مقارنة عامة ومرج

 

Ideologi Sikap OtakAlbum studio karya Ahmad BandDirilis3 Juli 1998GenreRock, pop, rock alternatif, grungeDurasi51:34LabelAquarius MusikindoAhmad Dhani ProductionProduserAhmad Dhani Ideologi Sikap Otak adalah satu-satunya album musik grup musik Indonesia, Ahmad Band. Album ini dirilis pada tahun 1998. Di album ini musik Ahmad Band kental dengan nuansa rock dengan lirik yang menyidir pemerintahan, tetapi dengan sedikit dibumbui tema cinta di beberapa lagunya. Album ini memiliki lagu unggula...

 

فرسان رؤيا يوحنا الأربعة نبؤات الكتاب المقدس هي الإيمان بوجود نبؤات في الكتاب المقدس، حيث يقوم المؤمنون بها بتفسير الأسفار التي يعتقدون أنها تحوي أوصافا عن أحداث عالمية وكوارث طبيعية ومستقبل إسرائيل ومجيء مسيح ومملكة مسيانية ومصير البشرية.[1][2][3] فسرت عدة مقا...

51°30′51″N 0°13′40″W / 51.51430°N 0.22790°W / 51.51430; -0.22790 ألعاب أولمبية صيفية 1908 لندن، المملكة المتحدة الألعاب الأولمبية الصيفية 1908 1904 1912 الدول المشاركة 22 الرياضيون المشاركون 2008 المسابقات 110، في 22 رياضة انطلاق الألعاب 27 أبريل 1908  المفتتح الرسمي إدوارد السابع ملك المملكة ال

 

Orthodox Jewish congregation in Atlanta, Georgia Beth Jacob AtlantaReligionAffiliationOrthodox JudaismEcclesiastical or organizational statusSynagogueLeadershipRabbi Ilan D. FeldmanStatusActiveLocationLocation1855 Lavista Road, Atlanta, GeorgiaCountryUnited StatesLocation in AtlantaGeographic coordinates33°49′00″N 84°19′35″W / 33.816625°N 84.326498°W / 33.816625; -84.326498ArchitectureDate established1943Websitebethjacobatlanta.org Congregation Beth Jacob i...

 

يفتقر محتوى هذه المقالة إلى الاستشهاد بمصادر. فضلاً، ساهم في تطوير هذه المقالة من خلال إضافة مصادر موثوق بها. أي معلومات غير موثقة يمكن التشكيك بها وإزالتها. (يناير 2022) الساق المتفلسة (بالإنجليزية: Scaly leg)‏ هو مرض يصيب الدجاج وطيور أخرى. يسبب المرض الحمنانة المبدلة وهي سوس طف...

Circuito callejero del EUR Tipo Circuito urbano de carrerasUbicación Roma, ItaliaCoordenadas 41°50′04″N 12°28′23″E / 41.834389, 12.473167Eventos Fórmula ELongitud 2.860 kmCurvas 19Vuelta récord 1:40.482 (Fórmula E)Jake Dennis Andretti-Porsche (2023)Inauguración 14 de abril de 2018Escapatorias Asfalto[editar datos en Wikidata]El Circuito callejero del EUR es un circuito urbano de carreras ubicado en Roma, Italia. Fue anunciado en octubre de 20...

 

Untuk tempat lain yang bernama sama, lihat Grogol (disambiguasi). GrogolDesaKantor Desa GrogolNegara IndonesiaProvinsiJawa TengahKabupatenSukoharjoKecamatanGrogolKode pos57552Kode Kemendagri33.11.09.2008 Luas... km²Jumlah penduduk... jiwaKepadatan... jiwa/km² Grogol adalah desa di kecamatan Grogol, Sukoharjo, Jawa Tengah, Indonesia. Pembagian wilayah Desa Grogol terdiri dari beberapa dukuh, antara lain: Bacem Grogol Kaliwingko Manang Sanggarahan Sidorejo Tambak Pendidikan Lembaga pendi...

 

Bagian dari seri tentangGereja Ortodoks TimurMosaik Kristos Pantokrator, Hagia Sofia Ikhtisar Struktur Teologi (Sejarah teologi) Liturgi Sejarah Gereja Misteri Suci Pandangan tentang keselamatan Pandangan tentang Maria Pandangan tentang ikon Latar belakang Penyaliban / Kebangkitan / KenaikanYesus Agama Kristen Gereja Kristen Suksesi apostolik Empat Ciri Gereja Ortodoksi Organisasi Otokefali Kebatrikan Batrik Ekumenis Tatanan keuskupan Klerus Uskup Imam Diakon Monastisisme Tingkatan ...

Squier-class transport ship for the U.S. Navy For other ships with the same name, see USS General R. M. Blatchford. General R. M. Blatchford (T-AP-153) History United States NameGeneral R. M. Blatchford NamesakeRichard M. Blatchford Builder Kaiser Co., Inc. Richmond, California Laid downdate unknown Launched27 August 1944 Acquired26 January 1945 Commissioned26 January 1945 Decommissioned12 June 1946 In service after June 1946 (Army) 1 March 1950 (MSTS) Out of service 1 March 1950 (Army) Janua...

 

Cable railway in Baku, Azerbaijan Baku FunicularBakı funikulyoruNew building of the Baku Funicular40°21′30″N 49°49′43″E / 40.3584°N 49.8285°E / 40.3584; 49.8285LocationBaku, AzerbaijanCompletion date1960 Baku Funicular (Azerbaijani: Bakı funikulyoru) is a funicular system in Baku, Azerbaijan. It connects a square on Neftchilar Avenue and Martyrs' Lane.[1] It is the first and remains the only funicular system in the country. Technical characte...

 

明洋型測量船 基本情報艦種 中型測量船運用者  海上保安庁就役期間 1990年 - 現在前級 天洋次級 最新要目常備排水量 1,035トン総トン数 621トン全長 60.0メートル (196.9 ft)最大幅 10.5メートル (34 ft)深さ 5.0メートル (16.4 ft)吃水 3.0メートル (9.8 ft)主機 ダイハツ6DLM-24ディーゼルエンジン×2基推進器 可変ピッチ・プロペラ×2軸出力 2,200馬力速力 15.8ノット航続距...

48°11′51″N 16°21′36″E / 48.197615°N 16.360102°E / 48.197615; 16.360102 Café Savoy The Café Savoy (formerly Café Wienzeile) is a Viennese coffee house and gay bar on the left bank of the Wien river (Linke Wienzeile) in Mariahilf district. It was opened in 1896.[1] The building itself was designed and built by the architect Franz von Neumann in 1896 and 1897, commissioned by textile manufacturer Julius Léon von Wernburg, who bought the property in...

 

Maria Montessori Maria Montessori (1913) Data i miejsce urodzenia 31 sierpnia 1870 Chiaravalle, Włochy Data i miejsce śmierci 6 maja 1952 Noordwijk, Holandia Miejsce spoczynku Noordwijk Zawód, zajęcie lekarz, pedagog Narodowość włoska Alma Mater Uniwersytet Rzymski „La Sapienza” Wyznanie katolicyzm Dzieci Mario Montessori Sr. Multimedia w Wikimedia Commons Maria Tekla Artemisia Montessori (ur. 31 sierpnia 1870 w Chiaravalle, zm. 6 maja 1952 w Noordwijk aan Zee w Holandii)...

 

British actress Ingrid Hafner Ingrid Hafner (13 November 1936 – 20 May 1994) was a British actress, born in London. Her father was Raoul Hafner, an Austrian helicopter pioneer, and her mother Eileen Myra McAdam was a descendant of Scottish-born John Loudon McAdam, the road builder.[1] Career Film and television Her first film role was as Ursula in 'The Quarry', made for television and directed by John Boorman - his first fiction work as distinct from his documentary films for the BB...

Stefania Spampinato Stefania Spampinato (Catania, 17 luglio 1982) è un'attrice italiana, nota per il ruolo di Carina DeLuca nelle serie televisive Grey's Anatomy e Station 19. Indice 1 Biografia 2 Filmografia 2.1 Attrice 2.1.1 Cinema 2.1.2 Televisione 2.2 Doppiatrice 3 Doppiatrici italiane 4 Note 5 Altri progetti 6 Collegamenti esterni Biografia All'età di sei anni iniziò a studiare danza. Dopo essersi diplomata al Liceo Classico Mario Cutelli di Catania, con il massimo dei voti, si trasfe...

 

2012 American musical comedy film by Jason Moore For other uses, see Pitch Perfect (disambiguation). Not to be confused with perfect pitch. Pitch PerfectTheatrical release posterDirected byJason MooreScreenplay byKay CannonBased onPitch Perfect: The Quest for Collegiate a Cappella Gloryby Mickey RapkinProduced by Paul Brooks Max Handelman Elizabeth Banks Starring Anna Kendrick Skylar Astin Rebel Wilson Adam DeVine Anna Camp Brittany Snow John Michael Higgins Elizabeth Banks CinematographyJuli...

 

Legislative branch of the Johor state government Johor State Legislative Assembly Dewan Negeri Johor柔佛州议会ديوان نݢري جوهر‎15th Johor State AssemblyInsignia of Johor State Legislative AssemblyTypeTypeUnicameral HistoryFounded1959LeadershipSultanSultan Ibrahim Al-Marhum Sultan Iskandar Al-Haj since 23 January 2010 (2010-01-23) SpeakerMohd Puad Zarkashi, BN-UMNO since 21 April 2022 (2022-04-21) Deputy SpeakerSamsolbari Jamali, BN-...

Anant GuptaBorn (1965-01-08) 8 January 1965 (age 58)Delhi, IndiaNationalityIndianCitizenshipIndiaAlma materUniversity of Bombay (B.Sc.)University of Liverpool (M.Sc.)Occupation(s)Founder Chairman & CEO, TECHCELXKnown forAuthor of The Blackbook on the Remote Infrastructure Management (RIM) Industry – Demystifying the third 'wave' of Outsourcing Anant Gupta (born 8 January 1965) is Founder Chairman & CEO, TECHCELX, an integrated business acceleration and investment firm...

 

US Army fort in Virginia, US This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Fort Gregg-Adams – news · newspapers · books · scholar · JSTOR (October 2017) (Learn how and when to remove this template message) Fort Gregg-Adamseponym: Lieutenant General Arthur J. Gregg and Lieutenant Colonel Charity Adams Earle...

 

Strategi Solo vs Squad di Free Fire: Cara Menang Mudah!