You should use format strings for things like this:

```python
api_url = "https://{0}:{1}/{2}".format(api['domain'], etc, etc)
```