Skip to main content

A small Python package to request listings from marktplaats.nl

Project description

marktplaats-py

A small Python package to request listings from marktplaats.nl. It supports python 3.7+.

Installing

pip3 install marktplaats

Example

This is an example on how to use the library:

from datetime import datetime, timedelta

from marktplaats import SearchQuery, SortBy, SortOrder

search = SearchQuery("fiets", # Search query
                     zip_code="1016LV", # Zip code to base distance from
                     distance=100000, # Max distance from the zip code for listings
                     price_from=0, # Lowest price to search for
                     price_to=100, # Highest price to search for
                     limit=5, # Max listings (page size, max 25)
                     offset=0, # Offset for listings (page * limit)
                     sort_by=SortBy.OPTIMIZED, # DATE, PRICE, LOCATATION, OPTIMIZED
                     sort_order=SortOrder.ASC, # ASCending or DESCending
                     offered_since=datetime.now() - timedelta(days=7)) # Filter listings since a point in time

listings = search.get_listings()

for listing in listings:
    print(listing.title)
    print(listing.description)
    print(listing.price)
    print(listing.link)
    
    # the location object
    print(listing.location)
    
    # the seller object
    print(listing.seller)
    
    # the datetime object
    print(listing.date)
    
    # the full seller object (another request)
    print(listing.seller.get_seller())
    
    for image in listing.images:
        print(image.medium)
    
    
    print("-----------------------------")

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

marktplaats-0.1.5.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

marktplaats-0.1.5-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file marktplaats-0.1.5.tar.gz.

File metadata

  • Download URL: marktplaats-0.1.5.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for marktplaats-0.1.5.tar.gz
Algorithm Hash digest
SHA256 e43a3ba4610256b0ab3f61caebc1bdac55d44819526be0d6fb2d3fe1b7113bf8
MD5 d96cae04f50b3d5731e6b37221a1b0ce
BLAKE2b-256 76f75d916765926417e46882b4f6d1f72814a5bfbd90d718aa22536cae25668f

See more details on using hashes here.

Provenance

The following attestation bundles were made for marktplaats-0.1.5.tar.gz:

Publisher: publish_to_pypi.yaml on jensjeflensje/marktplaats-py

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

File details

Details for the file marktplaats-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: marktplaats-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for marktplaats-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6d9171c0ef6cac0af7d6e598560b1f5821d174a5ddb904fb85b961a7d9e0ef10
MD5 4c1f4ea99385bcdd225ad600bdecced8
BLAKE2b-256 8f28fa3385db405108ef0330fd8da70dd813c964b9c3d8d289fc1fbe55f2c9fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for marktplaats-0.1.5-py3-none-any.whl:

Publisher: publish_to_pypi.yaml on jensjeflensje/marktplaats-py

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

Supported by

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