In order to make it easier for customers to call OpenAPI, the OpenAPI SDK is provided, and its main function is to provide wrapping for the signing process and complex query parameters. The SDK has been open-sourced on GitHub, and it is recommended to use the GitHub source code. Basic usage process:
bc will be used later to refer to a RangersClient instance)ak = '{replace with AK}' sk = '{replace with SK}' # Overseas users use non Chinese addresses; Privatization users requires the development of a private finder service domain name. Please refer to the service address description in the "OpenAPI Overview". url = '{Replace with non China or Finder service domain names}' bc = RangersClient(ak, sk, url=url) # Call specific interfaces bc.request("${path}",...)
Related interface description (specific method names will have different naming formats in different languages) :
Bc.data_finder ("${path}",...) , equivalent to bc.request ("/datafinder/${path}",...) , that is, before the path, add a/datafinder context-pathBc.data_rangers ("${path}",...) , equivalent to bc.request (/datarangers/${path} ",...) , that is, before the path, add a/datarangers context-pathBc.data_tester ("${path}",...) , equivalent to bc.request ("/datatester/${path}",...) , that is, before the path, add a/datatester context-pathBc.data_profile ("${path}",...) , equivalent to bc.request ("/dataprofile/${path}",...) , that is, before the path, add a/dataprofile context-pathBc.data_tracer ("${path}",...) , equivalent to bc.request ("/datatracer/${path}",...) , that is, before the path, add a/datatracer context-pathIt is recommended to use **the bc.request interface **in the future.
In addition, OpenAPI also provides query DSL Builder, specific interface reference source API description.
String ak = "xxx"; String sk = "xxx"; //Overseas and privatization need to specify the url address, you can refer to "OpenAPI Overview" String url="{Replace with non China or Finder service domain names}"; RangersClient bc = new RangersClient(ak, sk, url);
After downloading the Python SDK package, execute the following command in the shell to complete the installation:
Python requires version 3.7 and above pip install rangersdk-${version}.tar.gz
from rangersdk import RangersClient ak = 'xxx' # ak sk = 'xxx' # sk bc = RangersClient(ak, sk) #Overseas and privatization need to specify the url address, you can refer to "OpenAPI Overview", url = '{Replace with non China or Finder service domain names}' #Note that the parameters passed here must be written as url = url bc = RangersClient(ak, sk, url=url)
ak = "xxx" sk = "xxx" bc = new RangersClient(ak, sk) //Overseas and privatization need to specify the url address, you can refer to "OpenAPI Overview" url = '{Replace with non China or Finder service domain names}' bc = RangersClient(ak, sk, url=url)
var ( ak = "xxx" sk = "xxx" ) bc := dslcontent.NewRangersClient(ak, sk) //Overseas and privatization need to specify the url address, you can refer to "OpenAPI Overview" url = '{Replace with non China or Finder service domain names}' bc := dslcontent.NewRangersClientWithUrl(ak, sk, url)
ak = "xxx"; sk = "xxx"; $bc = new RangersClient($ak, $sk); //Overseas and privatization need to specify the url address, you can refer to "OpenAPI Overview" $url = '{Replace with non China or Finder service domain names}' $bc = new RangersClient($ak, $sk, $url);