Skip to content

netkaruma/search1688api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1688 API 图片|文字搜索产品

一个用于通过图片|文字在1688.com上搜索产品的Python库。

安装

pip install search1688api

使用方法

同步版本

from search1688api import Sync1688Session

with Sync1688Session(debug = False, proxies = proxies) as session:

    # 要修改会话参数,可以直接访问会话对象
    session.cookies_dict['_m_h5_tk'] = '我的新令牌_1234567890'

    products = session.search_by_image("path/to/image.jpg")
    products = session.search_by_text("search query")

异步版本

from search1688api import Async1688Session
import asyncio

async def main():

    async with Async1688Session(debug = False, proxies = proxies) as session:
        response = await session.search_by_image("path/to/image.jpg")
        response = await session.search_by_text("rose-colored glasses")
        
asyncio.run(main())

方法

search_by_image(image_path: str, debug = True) -> List[]
search_by_text(image_path: str, debug = True) -> List[]

选项:

  1. image_path - 图像文件路径
  2. debug - 使用日志记录功能

许可证

MIT

About

一个用于通过图像和文本搜索1688.com|阿里巴巴网站上产品的库 eng: A library for searching products by image and text from the 1688.com|alibaba website

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages