# Python Example
URL: https://docs.valsight.ai/python-example/
Description: The following script connects to the api key endpoint, stores the cookie in the sessions and prints out all projects found in the instance.
The following script connects to the api key endpoint, stores the cookie in the sessions and prints out all projects found in the instance.

```
import requests, os,sys, json
baseurl = "https://instancename.valsight.eu/v1/"
username = 'username-as-shown-on-userpage'
api_key = '5bc333fe-xxxx-xxxx-xxxx-c04513aa2a0f'

session = requests.Session()
response = session.post( baseurl+ "apiKey", data={'username': username,'api_key': api_key})
r = session.get(baseurl+"projectSpaces/")
for p in json.loads(r.text):
    print("ID: %i \tBusiness Key: %s \tName: %s" %(p["id"], p['businessKey'], p['name']))
```
