Question: I would like to print specific data in a JSON but I get the following error: 

```sh
Traceback (most recent call last):
  File "script.py", line 47, in <module>
    print(link['data.file.url.short'])
TypeError: 'int' object has no attribute '__getitem__'

```

Here is the JSON: 

```
{ 
   "status":true,
   "data":{ 
      "file":{ 
         "url":{ 
            "full":"https://anonfile.com/y000H35fn3/yuh_txt",
            "short":"https://anonfile.com/y000H35fn3"
         },
         "metadata":{ 
            "id":"y000H35fn3",
            "name":"yuh.txt",
            "size":{ 
               "bytes":0,
               "readable":"0 Bytes"
            }
         }
      }
   }
}

```

I'm trying to get `data.file.url.short` which is the short value of the url 

Here is the script in question: 

```py
post = os.system('curl -F "file=@' + save_file + '" https://anonfile.com/api/upload')
link = json.loads(str(post))

print(link['data.file.url.short'])

```

Thanks

Answer: 
Other than os.system() return value mentioned by @John Gordon I think correct syntax to access `data.file.url.short` is `link['data']['file']['url']['short']`, since `json.loads` returns `dict`.
You are capturing the return code of the process created by os.system which is an integer.

Why dont you use the request class in the urllib module to perform that action within python?

```
import urllib.request
import json

urllib.request.urlretrieve('https://anonfile.com/api/upload', save_file)
json_dict = json.load(save_file)
print(json_dict['data']['file']['url']['short'])  # https://anonfile.com/y000H35fn3

```

Or if you don't need to save the file you can use the requests library:

```
import requests

json_dict = requests.get('https://anonfile.com/api/upload').json()
print(json_dict['data']['file']['url']['short'])  # https://anonfile.com/y000H35fn3

```