Long Request time using Python but it's ok using Postman or browser

I use the following python code to search I got the following result of about 63seconds
Time: 63.206882300000004
It’s fine and almost less then a second for Postman and browsers.
Many thanks in advance

import requests

import timeit

start = timeit.default_timer()

r = requests.get(“https://developers.onemap.sg/commonapi/search?searchVal=130014&returnGeom=Y&getAddrDetails=Y&pageNum=1”)

stop = timeit.default_timer()

print('Time: ', stop - start)

Ok I found out its a IPv6 IPv4 issue, investigating will update after investigation

Ok you need to add in the following to use only ipv4, guys (onemap developers roadmap you need to move up to support ipv6 too :smiley: cheers ) Hope this helps
import requests.packages.urllib3.util.connection as urllib3_cn

def allowed_gai_family():


return family

urllib3_cn.allowed_gai_family = allowed_gai_family