Content API

class mini.apis.api_content.QueryWiKi(is_serial: bool = True, query: Optional[str] = None)[source]

Bases: mini.apis.base_api.BaseApi

Encyclopedia api

Default Tencent Encyclopedia

Parameters
  • is_serial (bool) – Whether to wait for a reply, the default is True

  • query (str) – query content, cannot be empty or None

#WikiResponse.isSuccess: Is it successful

#WikiResponse.resultCode: Return code

async execute()[source]

Execute encyclopedia instructions

Returns

WikiResponse

class mini.apis.api_content.StartTranslate(is_serial: bool = True, query: Optional[str] = None, from_lan: mini.apis.api_config.LanType = LanType.CN, to_lan: mini.apis.api_config.LanType = LanType.EN, platform: mini.apis.api_config.ServicePlatform = ServicePlatform.BAIDU)[source]

Bases: mini.apis.base_api.BaseApi

Translation api

Default Baidu translation

Parameters
  • is_serial (bool) – Whether to wait for a reply, the default is True

  • query (str) – The translated content, cannot be empty or None

  • from_lan (LanType) – the original language of the translation, default CN, Chinese

  • to_lan (LanType) – target language for translation, default EN, English

  • platform (ServicePlatform) – translation platform, default BAIDU, use Baidu translation

#TranslateResponse.isSuccess: Is it successful, True or False

#TranslateResponse.resultCode: Result code

async execute()[source]

Execute translation instructions

Returns

TranslateResponse