推荐服务API
reze的Python项目详细描述
雷泽
一个Python客户机,便于使用Reze推荐API。在
如果您在Reze还没有帐户,您可以创建一个免费帐户here
安装
使用pip安装客户端:
pip install reze
(如果使用python3,请使用pip3而不是pip)
示例
# importfromreze.api_clientimportRezeClientfromreze.api_requestsimportSalebotAddInteraction,SalebotBoughtTogether,SalebotItemsToItemapp_id="your_app_id"app_key="your_key"server_url="current_reze_api_server"client=RezeClient(app_id,app_key,server_url)# Send the data to Rezerequest_add_interaction=SalebotAddInteraction(1,"tag_content",1,"VIEW")print(client.send(request_add_interaction))# Get recommendationsrequest_bought_together=SalebotBoughtTogether("bô")recommended_bought_together=client.send(request_bought_together)print("Bought together items: ")fortaginrecommended_bought_together['data']:print(tag['tag'])# Get recommendationsrequest_items_to_item=SalebotItemsToItem("bô")recommended_items_to_item=client.send(request_items_to_item)print("Recommended items to item: ")fortaginrecommended_items_to_item['data']:print(tag['tag'])
- 项目
标签: