Web APIs
Publish date: Aug 18, 2019
Last updated: Apr 22, 2020
Last updated: Apr 22, 2020
Death is inevitable, might get it over with, be glad there is an outlet close enough to the bathtub.
API is a communication interface to enable communication b/w various programs, softwares, computers, web application over variou networks
- How to quickly prototype APIs?
- How to design an API?
- How to document APIs?
- How to crawl/walk over APIs?
- scrapy python
- API Inspirations - steal like an artist
- Public APIs API
REST constraints
- uniform interface
- client -server
- stateless
- cachable
- Layerred system
- Executable code - optional
- C - POST or PUT
- R - GET
- U - PUT or POST
- D - DELETE
Application Programming Interfaces provides means to connect a URL to a available web-resource
- Postman can generate and publish APIs documentation
- Using AppScript to capture and collecct information in sheets
Usages
- Displaying random geeky, math jokes, motivational quotes
- Search iTunes store for music
- GIPHY Stickers
- Pokemon API
- Get current ISS location
- Get Google FIT data to spreadsheet
- Which technologies a website is using?
Making promise based API calls from sheets!
Use flush()
to apply all pending Spreadsheet changes.
Google APIs
- https://developers.google.com/oauthplayground/#step3&apisSelect=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&url=https%3A%2F%2Fwww.googleapis.com%2Fdrive%2Fv3%2Fabout%3Ffields%3D*&content_type=application%2Fjson&http_method=GET&useDefaultOauthCred=unchecked&oauthEndpointSelect=Google&oauthAuthEndpointValue=https%3A%2F%2Faccounts.google.com%2Fo%2Foauth2%2Fv2%2Fauth&oauthTokenEndpointValue=https%3A%2F%2Foauth2.googleapis.com%2Ftoken&includeCredentials=unchecked&accessTokenType=bearer&autoRefreshToken=unchecked&accessType=offline&prompt=consent&response_type=code&wrapLines=on
- https://stackoverflow.com/questions/32076503/using-postman-to-access-oauth-2-0-google-apis
curl 'https://www.googleapis.com/drive/v3/about?fields=*' -H 'authority: www.googleapis.com' -H 'pragma: no-cache' -H 'cache-control: no-cache' -H 'accept: application/json, text/plain, */*' -H 'origin: http://localhost:3000' -H 'authorization: https://www.googleapis.com/drive/v3/about' -H 'sec-fetch-dest: empty' -H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36' -H 'sec-fetch-site: cross-site' -H 'sec-fetch-mode: cors' -H 'referer: https://www.googleapis.com/' -H 'accept-language: en-US,en;q=0.9' --compressed
Footnotes
[1]: Some cool and funny APIs to work with [^2]: