My QA Projects

QA Projects I was involded.

View on GitHub

APIs [Application Programming Interface]

API Server Interaction

Requests Module and APIs

API Example

image of screenshot

import request
import json

url = 'https://universities.hipolabs.com/search'
p = {'country': 'United states', 'name': 'berkeley'}
response = requests.get(url, p)
if response.ok:
    contents = json.loads(response.text)
    # json.loads converts a json string into a python object
    for e in contents:
        print(e['name'], e['web_pages'])

API Example - Formatted JSON

[
    {
        "domains": ["berkeley.edu"],
        "web_pages": ["http://www.berkeley.edu/"],
        "state-province": null,
        "country": "United States",
        "Alpha_two_code": "US"
    },
    {
        "domains": ["berkeleycitycollege.edu"],
        "web_pages": ["http://www.berkeleycitycollege.edu/wp/"],
        "state-province": null,
        "country": "United States",
        "Alpha_two_code": "US"
    }
]

API Limitations