Git Product home page Git Product logo

eleme_reapi's Introduction

eleme_reapi

【自用】 借助Python的饿了么API 同步请求 【eleme_reapi】模块

另外还在分支中更新了用于美团接口的【meituan_reapi】模块

可能只适用于医药类接口

官方API文档:https://open-be.ele.me/

依赖

Python3.8.2

requests==2.23.0

文档接口调用示例

  • cmd,接口指令
  • body,应用级参数
import eleme_reapi as ele

es = ele.sender(source="61260", secret='185bec8dacd85500')

body = {"shop_id": "test_681501_61260", "upc": "6926603501109"}

res = es.request(cmd="sku.stdupc.exist", body=body)

from pprint import pprint
pprint(res)

输出

{'body': {'data': {'std_flag': 1, 'upc': '6926603501109'},
          'errno': 0,
          'error': 'success'},
 'cmd': 'resp.sku.stdupc.exist',
 'encrypt': 'des.v1',
 'sign': 'AC2DC057B518A2350A5ABA5BD8214650',
 'source': '61260',
 'ticket': '16738AEC-53FC-4442-9FDA-119E4FBD8720',
 'timestamp': 1585794397,
 'version': '3'}

附带的爬取功能

  • get_shop_category_info,爬取指定门店下的分类信息
  • get_foods_by_category,爬取指定门店指定分类下的商品信息
import eleme_reapi as ele

res = ele.collect.get_shop_category_info(shop_id = 2233310913)

pprint(res)
#res['result']['detail']获得分类详细列表,包括每个分类的id

下载依赖模块时如果遇到ValueError: check_hostname requires server_hostname异常,请关闭系统代理或者下载whl文件离线安装。如果运行时出现这个错误,请传入proxies参数。

eleme_reapi's People

Contributors

nanarino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.