forked from goodop/api-imjustgood.com
-
Notifications
You must be signed in to change notification settings - Fork 5
/
info_resi_pengiriman.py
30 lines (22 loc) · 1.16 KB
/
info_resi_pengiriman.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from justgood import imjustgood
api = imjustgood("YOUR_APIKEY_HERE")
data = api.resi("jne", "CGK2H03789568816")
print(data)
# EXAMPLE GET CERTAIN ATTRIBUTES
result = "{}\n".format(data["result"]["courier"])
result += "\nResi : {}".format(data["result"]["code"])
result += "\nStatus : {}".format(data["result"]["status"])
result += "\nJenis : {}".format(data["result"]["service"])
result += "\nBerat : {}".format(data["result"]["weight"])
result += "\nHarga : {}".format(data["result"]["price"])
result += "\nPukul : {}".format(data["result"]["time"])
result += "\nTanggal : {}\n".format(data["result"]["date"])
result += "\nDeskripsi : {}\n".format(data["result"]["desc"])
result += "\nPengirim : {}, {}\n".format(data["result"]["sender"]["name"],data["result"]["sender"]["city"])
result += "\nPenerima : {}, {}\n".format(data["result"]["receiver"]["name"],data["result"]["receiver"]["city"])
if data["result"]["timeExpress"] != []:
for a in data["result"]["timeExpress"]:
result += "\n[ {} ]".format(a["date"])
result += "\nDeskripsi : {}".format(a["desc"])
result += "\nLokasi : {}\n".format(a["location"])
print(result)