API Usages
通过关键词搜索地点
Function Definition Requests HttpX
get_poi_by_keywords = {
"name" : "get_poi_by_keywords" ,
"description" : "通过关键词搜索地点" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"params" : {
"type" : "object" ,
"properties" : {
"keywords" : {
"type" : "string" ,
"title" : "Keywords" ,
"description" : "位置搜索的关键词 \n\n Example: 北京大学"
},
"region" : {
"type" : "string" ,
"title" : "Region" ,
"description" : "搜索的区域,支持城市中文名称 \n\n Example: 北京市"
},
"types" : {
"type" : "string" ,
"title" : "Types" ,
"description" : "目标类型的枚举值,以 `|` 标记分隔 \n\n Example: GAS_STATION|RESTAURANT|HOTEL|ATTRACTION"
},
"page" : {
"type" : "integer" ,
"title" : "Page" ,
"description" : "搜索的页数 \n\n Example: 1" ,
"default" : 1
},
"size" : {
"type" : "integer" ,
"title" : "Size" ,
"description" : "搜索结果每页所包含的结果数量 \n\n Example: 10" ,
"default" : 10
}
},
"required" : [
"keywords"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def get_poi_by_keywords (
keywords : str ,
region : str = None ,
types : str = None ,
page : int = 1 ,
size : int = 10 ,
** kwargs ,
):
url = "https://ipaas.mobiapp.cloud/v1/pois/place"
params = {
"keywords" : keywords ,
"region" : region ,
"types" : types ,
"page" : page ,
"size" : size
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def get_poi_by_keywords (
keywords : str ,
region : str = None ,
types : str = None ,
page : int = 1 ,
size : int = 10 ,
** kwargs ,
):
url = "https://ipaas.mobiapp.cloud/v1/pois/place"
params = {
"keywords" : keywords ,
"region" : region ,
"types" : types ,
"page" : page ,
"size" : size
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
通过经纬度查询附近的地点
Function Definition Requests HttpX
get_poi_by_location = {
"name" : "get_poi_by_location" ,
"description" : "通过经纬度查询附近的地点" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"params" : {
"type" : "object" ,
"properties" : {
"keywords" : {
"type" : "string" ,
"title" : "Keywords" ,
"description" : "搜索的关键词 \n\n Example: 餐厅"
},
"longitude" : {
"type" : "string" ,
"title" : "Longitude" ,
"description" : "搜索范围中心的经度坐标。小数精度均不得超过六位 \n\n Example: 116.310918"
},
"latitude" : {
"type" : "string" ,
"title" : "Latitude" ,
"description" : "搜索范围中心的纬度坐标。小数精度均不得超过六位 \n\n Example: 39.992873"
},
"radius" : {
"type" : "integer" ,
"title" : "Radius" ,
"description" : "搜索的范围,以米为单位。 \n\n Example: 3000" ,
"default" : 1000
},
"types" : {
"type" : "string" ,
"title" : "Types" ,
"description" : "目标类型的枚举值,以 `|` 标记分隔 \n\n Example: GAS_STATION|RESTAURANT|HOTEL|ATTRACTION"
},
"page" : {
"type" : "integer" ,
"title" : "Page" ,
"description" : "搜索的页数 \n\n Example: 1" ,
"default" : 1
},
"size" : {
"type" : "integer" ,
"title" : "Size" ,
"description" : "搜索结果每页所包含的结果数量 \n\n Example: 10" ,
"default" : 10
}
},
"required" : [
"longitude" ,
"latitude"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def get_poi_by_location (
longitude : str ,
latitude : str ,
keywords : str = None ,
radius : int = 1000 ,
types : str = None ,
page : int = 1 ,
size : int = 10 ,
** kwargs ,
):
url = "https://ipaas.mobiapp.cloud/v1/pois/nearby"
params = {
"longitude" : longitude ,
"latitude" : latitude ,
"keywords" : keywords ,
"radius" : radius ,
"types" : types ,
"page" : page ,
"size" : size
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def get_poi_by_location (
longitude : str ,
latitude : str ,
keywords : str = None ,
radius : int = 1000 ,
types : str = None ,
page : int = 1 ,
size : int = 10 ,
** kwargs ,
):
url = "https://ipaas.mobiapp.cloud/v1/pois/nearby"
params = {
"longitude" : longitude ,
"latitude" : latitude ,
"keywords" : keywords ,
"radius" : radius ,
"types" : types ,
"page" : page ,
"size" : size
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
根据起终点坐标检索符合条件的驾车路线规划方案
Function Definition Requests HttpX
get_driving_direction = {
"name" : "get_driving_direction" ,
"description" : "根据起终点坐标检索符合条件的驾车路线规划方案" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"params" : {
"type" : "object" ,
"properties" : {
"origin_longitude" : {
"type" : "string" ,
"title" : "Origin Longitude" ,
"description" : "起点经度 \n\n Example: 116.466485"
},
"origin_latitude" : {
"type" : "string" ,
"title" : "Origin Latitude" ,
"description" : "起点纬度 \n\n Example: 39.995197"
},
"destination_longitude" : {
"type" : "string" ,
"title" : "Destination Longitude" ,
"description" : "目的地经度 \n\n Example: 116.46424"
},
"destination_latitude" : {
"type" : "string" ,
"title" : "Destination Latitude" ,
"description" : "目的地纬度 \n\n Example: 43.345456"
}
},
"required" : [
"origin_longitude" ,
"origin_latitude" ,
"destination_longitude" ,
"destination_latitude"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def get_driving_direction (
origin_longitude : str ,
origin_latitude : str ,
destination_longitude : str ,
destination_latitude : str ,
** kwargs ,
):
url = "https://ipaas.mobiapp.cloud/v1/direction/driving"
params = {
"origin_longitude" : origin_longitude ,
"origin_latitude" : origin_latitude ,
"destination_longitude" : destination_longitude ,
"destination_latitude" : destination_latitude
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def get_driving_direction (
origin_longitude : str ,
origin_latitude : str ,
destination_longitude : str ,
destination_latitude : str ,
** kwargs ,
):
url = "https://ipaas.mobiapp.cloud/v1/direction/driving"
params = {
"origin_longitude" : origin_longitude ,
"origin_latitude" : origin_latitude ,
"destination_longitude" : destination_longitude ,
"destination_latitude" : destination_latitude
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
根据起终点坐标检索符合条件的步行路线规划方案
Function Definition Requests HttpX
get_walking_route_by_location = {
"name" : "get_walking_route_by_location" ,
"description" : "根据起终点坐标检索符合条件的步行路线规划方案" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"params" : {
"type" : "object" ,
"properties" : {
"origin_longitude" : {
"type" : "string" ,
"title" : "Origin Longitude" ,
"description" : "出发地点坐标的经度 \n\n Example: 116.466485"
},
"origin_latitude" : {
"type" : "string" ,
"title" : "Origin Latitude" ,
"description" : "出发地点坐标的纬度 \n\n Example: 39.995197"
},
"destination_longitude" : {
"type" : "string" ,
"title" : "Destination Longitude" ,
"description" : "目的地坐标的经度 \n\n Example: 116.46424"
},
"destination_latitude" : {
"type" : "string" ,
"title" : "Destination Latitude" ,
"description" : "目的地坐标的纬度 \n\n Example: 40.345456"
}
},
"required" : [
"origin_longitude" ,
"origin_latitude" ,
"destination_longitude" ,
"destination_latitude"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def get_walking_route_by_location (
origin_longitude : str ,
origin_latitude : str ,
destination_longitude : str ,
destination_latitude : str ,
** kwargs ,
):
url = "https://ipaas.mobiapp.cloud/v1/direction/walking"
params = {
"origin_longitude" : origin_longitude ,
"origin_latitude" : origin_latitude ,
"destination_longitude" : destination_longitude ,
"destination_latitude" : destination_latitude
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def get_walking_route_by_location (
origin_longitude : str ,
origin_latitude : str ,
destination_longitude : str ,
destination_latitude : str ,
** kwargs ,
):
url = "https://ipaas.mobiapp.cloud/v1/direction/walking"
params = {
"origin_longitude" : origin_longitude ,
"origin_latitude" : origin_latitude ,
"destination_longitude" : destination_longitude ,
"destination_latitude" : destination_latitude
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
根据起终点坐标检索符合条件的骑行路线规划方案
Function Definition Requests HttpX
get_cycling_direction = {
"name" : "get_cycling_direction" ,
"description" : "根据起终点坐标检索符合条件的骑行路线规划方案" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"params" : {
"type" : "object" ,
"properties" : {
"origin_longitude" : {
"type" : "string" ,
"title" : "Origin Longitude" ,
"description" : "起点经度 \n\n Example: 117.466485"
},
"origin_latitude" : {
"type" : "string" ,
"title" : "Origin Latitude" ,
"description" : "起点纬度 \n\n Example: 39.995197"
},
"destination_longitude" : {
"type" : "string" ,
"title" : "Destination Longitude" ,
"description" : "目的地经度 \n\n Example: 116.46424"
},
"destination_latitude" : {
"type" : "string" ,
"title" : "Destination Latitude" ,
"description" : "目的地纬度 \n\n Example: 40.020642"
}
},
"required" : [
"origin_longitude" ,
"origin_latitude" ,
"destination_longitude" ,
"destination_latitude"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def get_cycling_direction (
origin_longitude : str ,
origin_latitude : str ,
destination_longitude : str ,
destination_latitude : str ,
** kwargs ,
):
url = "https://ipaas.mobiapp.cloud/v1/direction/bicycling"
params = {
"origin_longitude" : origin_longitude ,
"origin_latitude" : origin_latitude ,
"destination_longitude" : destination_longitude ,
"destination_latitude" : destination_latitude
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def get_cycling_direction (
origin_longitude : str ,
origin_latitude : str ,
destination_longitude : str ,
destination_latitude : str ,
** kwargs ,
):
url = "https://ipaas.mobiapp.cloud/v1/direction/bicycling"
params = {
"origin_longitude" : origin_longitude ,
"origin_latitude" : origin_latitude ,
"destination_longitude" : destination_longitude ,
"destination_latitude" : destination_latitude
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
根据起终点坐标检索符合条件的电动车路线规划方案
Function Definition Requests HttpX
get_electric_bicycle_route_by_location = {
"name" : "get_electric_bicycle_route_by_location" ,
"description" : "根据起终点坐标检索符合条件的电动车路线规划方案" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"params" : {
"type" : "object" ,
"properties" : {
"origin_longitude" : {
"type" : "string" ,
"title" : "Origin Longitude" ,
"description" : "出发地点坐标的经度 \n\n Example: 116.345456"
},
"origin_latitude" : {
"type" : "string" ,
"title" : "Origin Latitude" ,
"description" : "出发地点坐标的纬度 \n\n Example: 39.995197"
},
"destination_longitude" : {
"type" : "string" ,
"title" : "Destination Longitude" ,
"description" : "目的地坐标的经度 \n\n Example: 116.46424"
},
"destination_latitude" : {
"type" : "string" ,
"title" : "Destination Latitude" ,
"description" : "目的地坐标的纬度 \n\n Example: 40.234564"
}
},
"required" : [
"origin_longitude" ,
"origin_latitude" ,
"destination_longitude" ,
"destination_latitude"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def get_electric_bicycle_route_by_location (
origin_longitude : str ,
origin_latitude : str ,
destination_longitude : str ,
destination_latitude : str ,
** kwargs ,
):
url = "https://ipaas.mobiapp.cloud/v1/direction/electrobike"
params = {
"origin_longitude" : origin_longitude ,
"origin_latitude" : origin_latitude ,
"destination_longitude" : destination_longitude ,
"destination_latitude" : destination_latitude
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def get_electric_bicycle_route_by_location (
origin_longitude : str ,
origin_latitude : str ,
destination_longitude : str ,
destination_latitude : str ,
** kwargs ,
):
url = "https://ipaas.mobiapp.cloud/v1/direction/electrobike"
params = {
"origin_longitude" : origin_longitude ,
"origin_latitude" : origin_latitude ,
"destination_longitude" : destination_longitude ,
"destination_latitude" : destination_latitude
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
根据起终点坐标检索符合条件的公共交通路线规划方案
Function Definition Requests HttpX
get_transit_integrated_direction = {
"name" : "get_transit_integrated_direction" ,
"description" : "根据起终点坐标检索符合条件的公共交通路线规划方案" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"params" : {
"type" : "object" ,
"properties" : {
"origin_longitude" : {
"type" : "string" ,
"title" : "Origin Longitude" ,
"description" : "起点经度 \n\n Example: 116.466485"
},
"origin_latitude" : {
"type" : "string" ,
"title" : "Origin Latitude" ,
"description" : "起点纬度 \n\n Example: 39.995197"
},
"destination_longitude" : {
"type" : "string" ,
"title" : "Destination Longitude" ,
"description" : "终点经度 \n\n Example: 116.46424"
},
"destination_latitude" : {
"type" : "string" ,
"title" : "Destination Latitude" ,
"description" : "终点纬度 \n\n Example: 40.345456"
},
"origin_city" : {
"type" : "string" ,
"title" : "Origin City" ,
"description" : "起点城市 \n\n Example: 北京市"
},
"destination_city" : {
"type" : "string" ,
"title" : "Destination City" ,
"description" : "终点城市 \n\n Example: 北京市"
}
},
"required" : [
"origin_longitude" ,
"origin_latitude" ,
"destination_longitude" ,
"destination_latitude" ,
"origin_city" ,
"destination_city"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def get_transit_integrated_direction (
origin_longitude : str ,
origin_latitude : str ,
destination_longitude : str ,
destination_latitude : str ,
origin_city : str ,
destination_city : str ,
** kwargs ,
):
url = "https://ipaas.mobiapp.cloud/v1/direction/transit/integrated"
params = {
"origin_longitude" : origin_longitude ,
"origin_latitude" : origin_latitude ,
"destination_longitude" : destination_longitude ,
"destination_latitude" : destination_latitude ,
"origin_city" : origin_city ,
"destination_city" : destination_city
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def get_transit_integrated_direction (
origin_longitude : str ,
origin_latitude : str ,
destination_longitude : str ,
destination_latitude : str ,
origin_city : str ,
destination_city : str ,
** kwargs ,
):
url = "https://ipaas.mobiapp.cloud/v1/direction/transit/integrated"
params = {
"origin_longitude" : origin_longitude ,
"origin_latitude" : origin_latitude ,
"destination_longitude" : destination_longitude ,
"destination_latitude" : destination_latitude ,
"origin_city" : origin_city ,
"destination_city" : destination_city
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
地理编码,将详细的结构化地址转换为高德经纬度坐标
Function Definition Requests HttpX
get_geocode = {
"name" : "get_geocode" ,
"description" : "地理编码,将详细的结构化地址转换为高德经纬度坐标" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"params" : {
"type" : "object" ,
"properties" : {
"address" : {
"type" : "string" ,
"title" : "Address" ,
"description" : "结构化地址信息。规则遵循:国家、省份、城市、区县、城镇、乡村、街道、门牌号码 \n\n Example: 北京市朝阳区阜通东大街6号"
},
"city" : {
"type" : "string" ,
"title" : "City" ,
"description" : "指定查询的城市。可输入城市的中文、拼音全拼 \n\n Example: 北京市"
}
},
"required" : [
"address"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def get_geocode ( address : str , city : str = None , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/geocode/geo"
params = {
"address" : address ,
"city" : city
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def get_geocode ( address : str , city : str = None , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/geocode/geo"
params = {
"address" : address ,
"city" : city
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
逆地理编码,将经纬度转换为详细结构化的地址信息
Function Definition Requests HttpX
get_address_detail_by_location = {
"name" : "get_address_detail_by_location" ,
"description" : "逆地理编码,将经纬度转换为详细结构化的地址信息" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"params" : {
"type" : "object" ,
"properties" : {
"longitude" : {
"type" : "string" ,
"title" : "Longitude" ,
"description" : "经度 \n\n Example: 116.310918"
},
"latitude" : {
"type" : "string" ,
"title" : "Latitude" ,
"description" : "纬度 \n\n Example: 39.989027"
}
},
"required" : [
"longitude" ,
"latitude"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def get_address_detail_by_location ( longitude : str , latitude : str , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/geocode/regeo"
params = {
"longitude" : longitude ,
"latitude" : latitude
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def get_address_detail_by_location ( longitude : str , latitude : str , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/geocode/regeo"
params = {
"longitude" : longitude ,
"latitude" : latitude
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
实时查询指定线路的交通信息
Function Definition Requests HttpX
get_road_traffic = {
"name" : "get_road_traffic" ,
"description" : "实时查询指定线路的交通信息" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"params" : {
"type" : "object" ,
"properties" : {
"road_level" : {
"type" : "string" ,
"title" : "Road Level" ,
"description" : "道路等级(HIGHWAY = 1,CITY_EXPRESSWAY = 2,NATIONAL_HIGHWAY = 2,HIGHWAY_ACCESS_ROAD = 3,MAIN_ROAD = 4,GENERAL_ROAD = 5,UNKNOWN_ROAD = 6) \n\n Example: HIGHWAY"
},
"road_name" : {
"type" : "string" ,
"title" : "Road Name" ,
"description" : "道路名称 \n\n Example: 西大街"
},
"city" : {
"type" : "string" ,
"title" : "City" ,
"description" : "城市名称或城市行政区的编码 \n\n Example: 西安市"
}
},
"required" : [
"road_level" ,
"road_name" ,
"city"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def get_road_traffic ( road_level : str , road_name : str , city : str , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/traffic/status/road"
params = {
"road_level" : road_level ,
"road_name" : road_name ,
"city" : city
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def get_road_traffic ( road_level : str , road_name : str , city : str , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/traffic/status/road"
params = {
"road_level" : road_level ,
"road_name" : road_name ,
"city" : city
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
实时查询圆形区域内的交通信息查询
Function Definition Requests HttpX
get_circle_traffic = {
"name" : "get_circle_traffic" ,
"description" : "实时查询圆形区域内的交通信息查询" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"params" : {
"type" : "object" ,
"properties" : {
"road_level" : {
"type" : "string" ,
"title" : "Road Level" ,
"description" : "道路等级(HIGHWAY = 1,CITY_EXPRESSWAY = 2,NATIONAL_HIGHWAY = 2,HIGHWAY_ACCESS_ROAD = 3,MAIN_ROAD = 4,GENERAL_ROAD = 5,UNKNOWN_ROAD = 6) \n\n Example: CITY_EXPRESSWAY"
},
"longitude" : {
"type" : "string" ,
"title" : "Longitude" ,
"description" : "中心点坐标的经度 \n\n Example: 116.3057764"
},
"latitude" : {
"type" : "string" ,
"title" : "Latitude" ,
"description" : "中心点坐标的纬度 \n\n Example: 39.98641364"
},
"radius" : {
"type" : "string" ,
"title" : "Radius" ,
"description" : "区域的半径 \n\n Example: 1000" ,
"default" : "1000"
}
},
"required" : [
"road_level" ,
"longitude" ,
"latitude"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def get_circle_traffic (
road_level : str ,
longitude : str ,
latitude : str ,
radius : str = "1000" ,
** kwargs ,
):
url = "https://ipaas.mobiapp.cloud/v1/traffic/status/circle"
params = {
"road_level" : road_level ,
"longitude" : longitude ,
"latitude" : latitude ,
"radius" : radius
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def get_circle_traffic (
road_level : str ,
longitude : str ,
latitude : str ,
radius : str = "1000" ,
** kwargs ,
):
url = "https://ipaas.mobiapp.cloud/v1/traffic/status/circle"
params = {
"road_level" : road_level ,
"longitude" : longitude ,
"latitude" : latitude ,
"radius" : radius
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
实时查询圆形区域内的交通信息查询
Function Definition Requests HttpX
get_rectangle_traffic = {
"name" : "get_rectangle_traffic" ,
"description" : "实时查询圆形区域内的交通信息查询" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"params" : {
"type" : "object" ,
"properties" : {
"road_level" : {
"type" : "string" ,
"title" : "Road Level" ,
"description" : "道路等级(HIGHWAY = 1,CITY_EXPRESSWAY = 2,NATIONAL_HIGHWAY = 2,HIGHWAY_ACCESS_ROAD = 3,MAIN_ROAD = 4,GENERAL_ROAD = 5,UNKNOWN_ROAD = 6) \n\n Example: GENERAL_ROAD"
},
"lower_left_longitude" : {
"type" : "string" ,
"title" : "Lower Left Longitude" ,
"description" : "左下顶点坐标的经度 \n\n Example: 116.351147"
},
"lower_left_latitude" : {
"type" : "string" ,
"title" : "Lower Left Latitude" ,
"description" : "左下顶点坐标的纬度 \n\n Example: 39.966309"
},
"upper_right_longitude" : {
"type" : "string" ,
"title" : "Upper Right Longitude" ,
"description" : "右上顶点坐标的经度 \n\n Example: 116.357134"
},
"upper_right_latitude" : {
"type" : "string" ,
"title" : "Upper Right Latitude" ,
"description" : "右上顶点坐标的纬度 \n\n Example: 39.968727"
}
},
"required" : [
"road_level" ,
"lower_left_longitude" ,
"lower_left_latitude" ,
"upper_right_longitude" ,
"upper_right_latitude"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def get_rectangle_traffic (
road_level : str ,
lower_left_longitude : str ,
lower_left_latitude : str ,
upper_right_longitude : str ,
upper_right_latitude : str ,
** kwargs ,
):
url = "https://ipaas.mobiapp.cloud/v1/traffic/status/rectangle"
params = {
"road_level" : road_level ,
"lower_left_longitude" : lower_left_longitude ,
"lower_left_latitude" : lower_left_latitude ,
"upper_right_longitude" : upper_right_longitude ,
"upper_right_latitude" : upper_right_latitude
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def get_rectangle_traffic (
road_level : str ,
lower_left_longitude : str ,
lower_left_latitude : str ,
upper_right_longitude : str ,
upper_right_latitude : str ,
** kwargs ,
):
url = "https://ipaas.mobiapp.cloud/v1/traffic/status/rectangle"
params = {
"road_level" : road_level ,
"lower_left_longitude" : lower_left_longitude ,
"lower_left_latitude" : lower_left_latitude ,
"upper_right_longitude" : upper_right_longitude ,
"upper_right_latitude" : upper_right_latitude
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
查询热点新闻
Function Definition Requests HttpX
get_bing_hotnews = {
"name" : "get_bing_hotnews" ,
"description" : "查询热点新闻" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"params" : {
"type" : "object" ,
"properties" : {
"category" : {
"type" : "string" ,
"title" : "Category" ,
"description" : "新闻类别(AUTO, BUSINESS, CHINA, EDUCATION, ENTERTAINMENT, MILITARY, REALESTATE, SCIENCEANDTECHNOLOGY, SOCIETY, SPORTS, WORLD) \n\n Example: BUSINESS" ,
"default" : "WORLD"
},
"freshness" : {
"type" : "string" ,
"title" : "Freshness" ,
"description" : "新闻的时间范围(DAY, WEEK, MONTH) \n\n Example: DAY" ,
"default" : "WEEK"
}
},
"required" : []
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def get_bing_hotnews ( category : str = "WORLD" , freshness : str = "WEEK" , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/search/hotnews/bing"
params = {
"category" : category ,
"freshness" : freshness
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def get_bing_hotnews ( category : str = "WORLD" , freshness : str = "WEEK" , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/search/hotnews/bing"
params = {
"category" : category ,
"freshness" : freshness
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
根据关键词查询新闻
Function Definition Requests HttpX
search_bing_news = {
"name" : "search_bing_news" ,
"description" : "根据关键词查询新闻" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"params" : {
"type" : "object" ,
"properties" : {
"query" : {
"type" : "string" ,
"title" : "Query" ,
"description" : "搜索的关键词 \n\n Example: 小米SU7"
},
"category" : {
"type" : "string" ,
"title" : "Category" ,
"description" : "新闻类别(AUTO, BUSINESS, CHINA, EDUCATION, ENTERTAINMENT, MILITARY, REALESTATE, SCIENCEANDTECHNOLOGY, SOCIETY, SPORTS, WORLD) \n\n Example: AUTO" ,
"default" : "WORLD"
},
"freshness" : {
"type" : "string" ,
"title" : "Freshness" ,
"description" : "新闻的时间范围(DAY, WEEK, MONTH) \n\n Example: DAY" ,
"default" : "WEEK"
}
},
"required" : [
"query"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def search_bing_news ( query : str , category : str = "WORLD" , freshness : str = "WEEK" , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/search/news/bing"
params = {
"query" : query ,
"category" : category ,
"freshness" : freshness
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def search_bing_news ( query : str , category : str = "WORLD" , freshness : str = "WEEK" , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/search/news/bing"
params = {
"query" : query ,
"category" : category ,
"freshness" : freshness
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
关键词搜索图片
Function Definition Requests HttpX
search_bing_images = {
"name" : "search_bing_images" ,
"description" : "关键词搜索图片" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"params" : {
"type" : "object" ,
"properties" : {
"query" : {
"type" : "string" ,
"title" : "Query" ,
"description" : "搜索的关键词 \n\n Example: 问界M9"
},
"count" : {
"type" : "integer" ,
"title" : "Count" ,
"description" : "返回的搜索结果数量 \n\n Example: 6" ,
"default" : 6
}
},
"required" : [
"query"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def search_bing_images ( query : str , count : int = 6 , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/search/images/bing"
params = {
"query" : query ,
"count" : count
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def search_bing_images ( query : str , count : int = 6 , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/search/images/bing"
params = {
"query" : query ,
"count" : count
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
关键词搜索网页
Function Definition Requests HttpX
search_bing = {
"name" : "search_bing" ,
"description" : "关键词搜索网页" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"params" : {
"type" : "object" ,
"properties" : {
"query" : {
"type" : "string" ,
"title" : "Query" ,
"description" : "搜索的关键词 \n\n Example: 陕西省2024年高考状元"
}
},
"required" : [
"query"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def search_bing ( query : str , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/search/bing"
params = {
"query" : query
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def search_bing ( query : str , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/search/bing"
params = {
"query" : query
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
查询未来15天的天气
Function Definition Requests HttpX
get_weather_days_period = {
"name" : "get_weather_days_period" ,
"description" : "查询未来15天的天气" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"params" : {
"type" : "object" ,
"properties" : {
"city" : {
"type" : "string" ,
"title" : "City" ,
"description" : "城市 \n\n Example: 北京市丰台区"
},
"start_date" : {
"type" : "string" ,
"schema_format" : "date" ,
"title" : "Start Date" ,
"description" : "开始日期 \n\n Example: 2024-08-23"
},
"end_date" : {
"type" : "string" ,
"schema_format" : "date" ,
"title" : "End Date" ,
"description" : "结束日期 \n\n Example: 2024-08-30"
}
},
"required" : [
"city" ,
"start_date" ,
"end_date"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def get_weather_days_period ( city : str , start_date : str , end_date : str , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/weather"
params = {
"city" : city ,
"start_date" : start_date ,
"end_date" : end_date
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def get_weather_days_period ( city : str , start_date : str , end_date : str , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/weather"
params = {
"city" : city ,
"start_date" : start_date ,
"end_date" : end_date
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
通过关键词搜索酒店
Function Definition Requests HttpX
query_hotels_nl = {
"name" : "query_hotels_nl" ,
"description" : "通过关键词搜索酒店" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"params" : {
"type" : "object" ,
"properties" : {
"query" : {
"type" : "string" ,
"title" : "Query" ,
"description" : "搜索关键词"
},
"return_direct" : {
"type" : "boolean" ,
"title" : "Return Direct" ,
"description" : "是否返回直接结果" ,
"default" : false
},
"show_fields" : {
"type" : "string" ,
"title" : "Show Fields" ,
"description" : "可返回字段"
}
},
"required" : [
"query"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def query_hotels_nl ( query : str , return_direct : boolean = False , show_fields : str = None , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/hotels/nl"
params = {
"query" : query ,
"return_direct" : return_direct ,
"show_fields" : show_fields
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def query_hotels_nl ( query : str , return_direct : boolean = False , show_fields : str = None , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/hotels/nl"
params = {
"query" : query ,
"return_direct" : return_direct ,
"show_fields" : show_fields
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
通过关键词搜索景点
Function Definition Requests HttpX
query_attractions_nl = {
"name" : "query_attractions_nl" ,
"description" : "通过关键词搜索景点" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"params" : {
"type" : "object" ,
"properties" : {
"query" : {
"type" : "string" ,
"title" : "Query" ,
"description" : "搜索关键词"
},
"return_direct" : {
"type" : "boolean" ,
"title" : "Return Direct" ,
"description" : "是否返回直接结果" ,
"default" : false
},
"show_fields" : {
"type" : "string" ,
"title" : "Show Fields" ,
"description" : "可返回字段"
}
},
"required" : [
"query"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def query_attractions_nl ( query : str , return_direct : boolean = False , show_fields : str = None , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/attractions/nl"
params = {
"query" : query ,
"return_direct" : return_direct ,
"show_fields" : show_fields
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def query_attractions_nl ( query : str , return_direct : boolean = False , show_fields : str = None , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/attractions/nl"
params = {
"query" : query ,
"return_direct" : return_direct ,
"show_fields" : show_fields
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
通过关键词搜索餐厅
Function Definition Requests HttpX
query_restaurants_nl = {
"name" : "query_restaurants_nl" ,
"description" : "通过关键词搜索餐厅" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"params" : {
"type" : "object" ,
"properties" : {
"query" : {
"type" : "string" ,
"title" : "Query" ,
"description" : "搜索关键词"
},
"return_direct" : {
"type" : "boolean" ,
"title" : "Return Direct" ,
"description" : "是否返回直接结果" ,
"default" : false
},
"show_fields" : {
"type" : "string" ,
"title" : "Show Fields" ,
"description" : "可返回字段"
}
},
"required" : [
"query"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def query_restaurants_nl ( query : str , return_direct : boolean = False , show_fields : str = None , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/restaurants/nl"
params = {
"query" : query ,
"return_direct" : return_direct ,
"show_fields" : show_fields
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def query_restaurants_nl ( query : str , return_direct : boolean = False , show_fields : str = None , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/restaurants/nl"
params = {
"query" : query ,
"return_direct" : return_direct ,
"show_fields" : show_fields
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
查询商品列表
Function Definition Requests HttpX
list_linkedmall_products = {
"name" : "list_linkedmall_products" ,
"description" : "查询商品列表" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"params" : {
"type" : "object" ,
"properties" : {
"shop_id" : {
"type" : "string" ,
"title" : "Shop Id" ,
"description" : "Linkedmall店铺ID"
},
"page_num" : {
"type" : "integer" ,
"title" : "Page Num" ,
"description" : "页码" ,
"default" : 1
},
"page_size" : {
"type" : "integer" ,
"title" : "Page Size" ,
"description" : "页大小" ,
"default" : 10
}
},
"required" : [
"shop_id"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def list_linkedmall_products ( shop_id : str , page_num : int = 1 , page_size : int = 10 , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/linkedmall/product/list"
params = {
"shop_id" : shop_id ,
"page_num" : page_num ,
"page_size" : page_size
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def list_linkedmall_products ( shop_id : str , page_num : int = 1 , page_size : int = 10 , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/linkedmall/product/list"
params = {
"shop_id" : shop_id ,
"page_num" : page_num ,
"page_size" : page_size
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
查询商品详情
Function Definition Requests HttpX
get_linkedmall_product = {
"name" : "get_linkedmall_product" ,
"description" : "查询商品详情" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"params" : {
"type" : "object" ,
"properties" : {
"product_id" : {
"type" : "string" ,
"title" : "Product Id" ,
"description" : "商品ID"
},
"shop_id" : {
"type" : "string" ,
"title" : "Shop Id" ,
"description" : "Linkedmall店铺ID"
}
},
"required" : [
"product_id" ,
"shop_id"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def get_linkedmall_product ( product_id : str , shop_id : str , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/linkedmall/product"
params = {
"product_id" : product_id ,
"shop_id" : shop_id
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def get_linkedmall_product ( product_id : str , shop_id : str , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/linkedmall/product"
params = {
"product_id" : product_id ,
"shop_id" : shop_id
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
创建采购单
Function Definition Requests HttpX
create_linkedmall_purchase_order = {
"name" : "create_linkedmall_purchase_order" ,
"description" : "创建采购单" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"json" : {
"properties" : {
"outer_purchase_order_id" : {
"type" : "string" ,
"title" : "Outer Purchase Order Id" ,
"description" : "订单ID"
},
"buyer_id" : {
"type" : "string" ,
"title" : "Buyer Id" ,
"description" : "用户ID"
},
"delivery_address" : {
"allOf" : [
{
"ref" : "#/components/schemas/DeliveryAddress"
}
],
"description" : "收货地址"
},
"products" : {
"items" : {
"ref" : "#/components/schemas/Product"
},
"type" : "array" ,
"title" : "Products" ,
"description" : "商品列表"
}
},
"type" : "object" ,
"required" : [
"outer_purchase_order_id" ,
"buyer_id" ,
"delivery_address" ,
"products"
],
"title" : "CreatePurchaseOrderRequest"
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def create_linkedmall_purchase_order (, ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/linkedmall/purchase/order"
params = {
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def create_linkedmall_purchase_order (, ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/linkedmall/purchase/order"
params = {
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
查看采购单状态
Function Definition Requests HttpX
query_linkedmall_purchase_order_status = {
"name" : "query_linkedmall_purchase_order_status" ,
"description" : "查看采购单状态" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"path_params" : {
"type" : "object" ,
"properties" : {
"purchase_order_id" : {
"type" : "string" ,
"title" : "Purchase Order Id"
}
},
"required" : [
"purchase_order_id"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def query_linkedmall_purchase_order_status (, ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/linkedmall/purchase/order/ {purchase_order_id} "
params = {
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def query_linkedmall_purchase_order_status (, ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/linkedmall/purchase/order/ {purchase_order_id} "
params = {
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
查看订单详情
Function Definition Requests HttpX
query_linkedmall_order_info = {
"name" : "query_linkedmall_order_info" ,
"description" : "查看订单详情" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"path_params" : {
"type" : "object" ,
"properties" : {
"order_id" : {
"type" : "string" ,
"title" : "Order Id"
}
},
"required" : [
"order_id"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def query_linkedmall_order_info (, ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/linkedmall/order/ {order_id} "
params = {
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def query_linkedmall_order_info (, ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/linkedmall/order/ {order_id} "
params = {
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
查看订单列表
Function Definition Requests HttpX
query_order_list = {
"name" : "query_order_list" ,
"description" : "查看订单列表" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"json" : {
"properties" : {
"page_number" : {
"type" : "integer" ,
"title" : "Page Number" ,
"description" : "页码" ,
"default" : 1
},
"page_size" : {
"type" : "integer" ,
"title" : "Page Size" ,
"description" : "页大小" ,
"default" : 10
},
"purchase_order_id" : {
"type" : "string" ,
"title" : "Purchase Order Id" ,
"description" : "采购单ID"
},
"order_id_list" : {
"items" : {
"type" : "string"
},
"type" : "array" ,
"title" : "Order Id List" ,
"description" : "订单ID列表"
}
},
"type" : "object" ,
"required" : [
"order_id_list"
],
"title" : "QueryOrderListRequest"
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def query_order_list (, ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/linkedmall/order/list"
params = {
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def query_order_list (, ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/linkedmall/order/list"
params = {
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
网页内容读取
Function Definition Requests HttpX
get_text_by_link = {
"name" : "get_text_by_link" ,
"description" : "网页内容读取" ,
"parameters" : {
"type" : "object" ,
"properties" : {
"params" : {
"type" : "object" ,
"properties" : {
"url" : {
"type" : "string" ,
"title" : "Url" ,
"description" : "网页url"
}
},
"required" : [
"url"
]
}
}
}
}
import requests
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
def get_text_by_link ( url : str , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/link/text"
params = {
"url" : url
}
try :
resp = requests . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None
import httpx
headers = {
"X-API-KEY" : "YOUR_API_KEY"
}
async def get_text_by_link ( url : str , ** kwargs ):
url = "https://ipaas.mobiapp.cloud/v1/link/text"
params = {
"url" : url
}
async with httpx . AsyncClient () as client :
try :
resp = await client . get ( url , params = params , headers = headers )
if resp . status_code == 200 :
return resp . json ()
return None
except Exception as e :
print ( e )
return None