Skip to main content

A very simple Python package for scraping Vinted. Supports both synchronous and asynchronous operations with automatic cookie management and typed responses.

Project description

Vinted Scraper

Package Version Python Version codecov Codacy Badge License FOSSA Status

A very simple Python package for scraping Vinted. Supports both synchronous and asynchronous operations with automatic cookie management and typed responses.

📖 Full Documentation | 💡 Examples | 📝 Changelog

Installation

Install using pip:

pip install vinted_scraper

Functions

The package offers the following methods:

search - Gets all items from the listing page based on search parameters.

Parameters

name type data type description
params optional Dict Query parameters like the pagination and so on

Returns: List[VintedItem] (VintedScraper) or Dict[str, Any] (VintedWrapper)

item - Reads item metadata (title, description, url, image) from the public item page.

The JSON item endpoint is blocked by the anti-bot protection and returns 403 (see #59), so the data is read from the public item page instead. Only the fields exposed by the page's OpenGraph <head> tags are populated, and only the <head> is streamed (the full page body is not downloaded).

Parameters

name type data type description
id required str The unique identifier of the item to retrieve
fields optional List[str] OG fields to extract (defaults to all available)

Returns: Optional[VintedItem] (VintedScraper) or Optional[Dict[str, Any]] (VintedWrapper) — the metadata (e.g. result["description"]), or None if the page has no description.

curl - Perform an HTTP GET request to the given endpoint.

Parameters

name type data type description
endpoint required str The endpoint to make the request to
params optional Dict Query parameters like the pagination and so on

Returns: VintedJsonModel (VintedScraper) or Dict[str, Any] (VintedWrapper)

Usage

from vinted_scraper import VintedScraper

scraper = VintedScraper("https://www.vinted.com")
items = scraper.search({"search_text": "board games"})

for item in items:
    print(f"{item.title} - {item.price}")

Check out the examples for more!

Debugging

To enable debug logging for troubleshooting:

import logging

# Configure logging BEFORE importing vinted_scraper
logging.basicConfig(
    level=logging.DEBUG,
    format="%(levelname)s:%(name)s:%(message)s"
)

from vinted_scraper import VintedScraper

scraper = VintedScraper("https://www.vinted.com")
scraper.search({"search_text": "board games"})
Debug output (click to expand)
DEBUG:vinted_scraper._vinted_wrapper:Initializing VintedScraper(baseurl=https://www.vinted.com, user_agent=None, session_cookie=auto-fetch, config=None)
DEBUG:vinted_scraper._vinted_wrapper:Refreshing session cookie
DEBUG:vinted_scraper._vinted_wrapper:Cookie fetch attempt 1/3
DEBUG:vinted_scraper._vinted_wrapper:Session cookie fetched successfully: eyJraWQiOiJFNTdZZHJ1...
DEBUG:vinted_scraper._vinted_wrapper:Calling search() with params: {'search_text': 'board games'}
DEBUG:vinted_scraper._vinted_wrapper:API Request: GET /api/v2/catalog/items with params {'search_text': 'board games'}
DEBUG:vinted_scraper._vinted_wrapper:API Response: /api/v2/catalog/items - Status: 200

Common Issues

  • 403 Forbidden Error: The Vinted JSON item endpoint frequently returns 403 errors (#59). Because of this, item() reads the item metadata from the public item page (a document navigation that is not blocked the same way) instead of the JSON API, so only the fields exposed by the page (title, description, url, image) are available.

  • Cookie Fetch Failed: If cookies cannot be fetched:

    • Verify the base URL is correct
    • Check your internet connection, some VPN are banned. Try manually getting the cookie by running the following:
      curl -v -c - -L "<base-url>" | grep access_token_web
    

License

This project is licensed under the MIT License - see the LICENSE file for details.

FOSSA Status

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vinted_scraper-4.0.0.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vinted_scraper-4.0.0-py3-none-any.whl (30.7 kB view details)

Uploaded Python 3

File details

Details for the file vinted_scraper-4.0.0.tar.gz.

File metadata

  • Download URL: vinted_scraper-4.0.0.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for vinted_scraper-4.0.0.tar.gz
Algorithm Hash digest
SHA256 67514cc00053a484d4214c76442da69eb1a90021bb2b5c099ef1511e627e41b3
MD5 276607431dfaa09b37ac9919380f028f
BLAKE2b-256 af4a8fe7ee4eb1320efdce451ace152f5126d4c903a64bcc7ddd922d3b9fdff8

See more details on using hashes here.

Provenance

The following attestation bundles were made for vinted_scraper-4.0.0.tar.gz:

Publisher: release.yml on Giglium/vinted_scraper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vinted_scraper-4.0.0-py3-none-any.whl.

File metadata

  • Download URL: vinted_scraper-4.0.0-py3-none-any.whl
  • Upload date:
  • Size: 30.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for vinted_scraper-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6b93b6fbf708558e343deec9599c531b778e2395d609df2f233df0a4a69029c
MD5 6c225e1c78c585d2e79b4237ebbfb7c1
BLAKE2b-256 1eafc521605a35d4818ab65d84164bef37a2ea3fa9209c0d772119dd339536f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for vinted_scraper-4.0.0-py3-none-any.whl:

Publisher: release.yml on Giglium/vinted_scraper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page