First API steps
Python, I choose you!
- APIs are developed using a back-end language
- Code runs on a server
- Back-end language used for this course: Python
- Why?
- Previous knowledge (1 ITF)
- Small learning curve (easy to learn)
- More and more often used in IT applications
- Dictionaries (built-in in Python) can be used to create JSON code
First API steps
Postman
Download Postman: https://www.postman.com/downloads/, create an account and log in
- Postman: software to test APIs
- Initially released in 2012 by Abhinav Asthana
- Free core functionality
Using Postman
Request 1
From the workspace: open a new tab to create your first API request
Enter the following link in the 'search bar' and press 'Send':
http://numbersapi.com/random/math
Watch the result in the bottom screen section
Result: a random fact about math The result of your query is a piece of plain text
Request 2
Enter the following link in the 'search bar' and press 'Send':
https://api.nationalize.io?name=michael
Use your own name in the link
Result: JSON code containing probable countries (by country code)