Skip to content

Instantly share code, notes, and snippets.

@gnh1201
Last active February 11, 2026 04:04
Show Gist options
  • Select an option

  • Save gnh1201/050901082adc7af40734c66fd09a102a to your computer and use it in GitHub Desktop.

Select an option

Save gnh1201/050901082adc7af40734c66fd09a102a to your computer and use it in GitHub Desktop.
쿠팡 검색 상품 Python으로 불러오기 (How to retrieve Coupang product search data with Python)

🛒 쿠팡 검색 상품 Python으로 불러오기 (소스코드 포함)

쿠팡 검색 상품 데이터를 Python으로 불러오는 예제입니다.


📦 1. 필요한 패키지 설치

pip install requests

Windows에서는 cmd, Linux/macOS에서는 bash에서 실행하시면 됩니다.


🐍 2. Python 소스 코드

# pip install requests
import requests
from urllib.parse import quote

BASE_URL = "https://cold-math-31f3.gnh1201.workers.dev/api/v1/products/search"

def main():
    keyword = "여성의류"
    url = f"{BASE_URL}?keyword={quote(keyword)}"

    response = requests.get(url, timeout=30)
    response.raise_for_status()
    data = response.json()

    if not data.get("ok"):
        print("API returned ok=false")
        return

    print("=== Product Search Result ===")
    print(f"Keyword : {data.get('keyword')}")
    print(f"Count   : {data.get('count')}")
    print()

    for idx, item in enumerate(data.get("items", []), 1):
        print(f"[{idx}]")
        print(f"Source : {item.get('source')}")
        print(f"Name   : {item.get('name')}")
        print(f"Price  : {item.get('price')}")
        print(f"Link   : {item.get('link')}")
        print(f"Image  : {item.get('image')}")
        print("-" * 60)

if __name__ == "__main__":
    main()

📄 3. 출력 예시

=== Product Search Result ===
Keyword : 여성의류
Count   : 10

[1]
Source : coupang
Name   : 디아웃핏 여성 울 기모 밴딩 슬랙스 스판 바지 팬츠 일자 세미 와이드 부츠컷
Price  : 39900
Link   : https://...
Image  : https://...
------------------------------------------------------------

[2]
Source : coupang
Name   : 해피유통 여성 가을겨울 캐주얼 니트 가디건 후드 지퍼 디자인 큰 주머니 베이직 아우터
Price  : 12600
Link   : https://...
Image  : https://...
------------------------------------------------------------
...

✅ 정리

위와 같이 실행하면 쿠팡 상품 검색 데이터를 Python에서 간단히 불러올 수 있습니다.

  • 검색 키워드만 변경하면 다양한 상품 조회 가능
  • JSON 응답 기반이므로 추가 가공/저장/DB 적재 등으로 확장 가능
  • 자동화 스크립트나 데이터 분석 파이프라인에도 활용 가능

🛒 Fetch Coupang Product Search Results with Python (Source code available)

This example demonstrates how to retrieve Coupang product search data.


📦 1. Install Required Package

pip install requests

Run this command in:

  • cmd on Windows
  • bash on Linux/macOS

🐍 2. Python Source Code

# pip install requests
import requests
from urllib.parse import quote

BASE_URL = "https://cold-math-31f3.gnh1201.workers.dev/api/v1/products/search"

def main():
    keyword = "women clothing"
    url = f"{BASE_URL}?keyword={quote(keyword)}"

    response = requests.get(url, timeout=30)
    response.raise_for_status()
    data = response.json()

    if not data.get("ok"):
        print("API returned ok=false")
        return

    print("=== Product Search Result ===")
    print(f"Keyword : {data.get('keyword')}")
    print(f"Count   : {data.get('count')}")
    print()

    for idx, item in enumerate(data.get("items", []), 1):
        print(f"[{idx}]")
        print(f"Source : {item.get('source')}")
        print(f"Name   : {item.get('name')}")
        print(f"Price  : {item.get('price')}")
        print(f"Link   : {item.get('link')}")
        print(f"Image  : {item.get('image')}")
        print("-" * 60)

if __name__ == "__main__":
    main()

📄 3. Example Output

=== Product Search Result ===
Keyword : women clothing
Count   : 10

[1]
Source : coupang
Name   : Women's Wool Banding Slacks Stretch Pants Semi-Wide Bootcut
Price  : 39900
Link   : https://...
Image  : https://...
------------------------------------------------------------

[2]
Source : coupang
Name   : Women's Casual Knit Cardigan Hoodie Zip Design with Large Pockets
Price  : 12600
Link   : https://...
Image  : https://...
------------------------------------------------------------
...

✅ Summary

With this script, you can easily retrieve Coupang product search data in Python.

  • Change the keyword value to search for different products
  • The API returns JSON, making it easy to process, store, or analyze
  • Suitable for automation scripts, data pipelines, or integration into larger systems
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment