API request with Python

What is API ?

Example of API and HTTP request, response

API requests

import requestsresponse=requests.get("https://jsonplaceholder.typicode.com/posts")response_data = response.json()print(response_data)

Endpoint and parameters


simple request

import requestsresponse=requests.get("https://jsonplaceholder.typicode.com/users?email=Sincere@april.biz")response_data = response.json()print(response_data)

Using params argument

import requestsresponse=requests.get("https://jsonplaceholder.typicode.com/users", params={"email":"Sincere@april.biz"})response_data = response.json()print(response_data)



Learning javascript and web-development

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store