Skip to content

Python API for retrieving information from olx.ba

Notifications You must be signed in to change notification settings

DustTheory/olxba-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

olxba-py

Python API for retrieving information from olx.ba

Installation

  • Install by simply running:
pip install git+https://github.com/ishakd00/olxba-py.git

Usage

Authentication

An olx.ba account is needed for this API to work. Authenticate by passing your login info to the OlxAPI constructor like so:

from olxba import OlxAPI 

parser = OlxAPI ('username', 'password')

Documentation

search(searchText, sortOrder, sortBy, category, id, condition, page)

Provides limited search functonality.

Parameters:
  • searchText - text you would enter into the search bar - string
  • sortOrder - Sort ascending or descending - string 'asc' or 'desc' (default: 'desc')
  • sortBy - By what property to sort - string 'price', 'date' or 'relevance'
  • category - Olx lowest subcategory id, I plan to make a table for this but for now you're on your own exploring on olx.ba - integer
  • id - Olx (?parent?) category id, still don't understand exactly how this works but it's similar to category and you can just leave it unset if you set category - integer
  • page - Search page number - integer

Returns:

List of listings.

getListingById(listingId) Returns instance of OlxListing for listing with listingId.

Parameters:
  • listingId - olx.ba listing id - integer

Returns:

Instance of OlxListing

class OlxListing

Properties:
  • listingId - integer
  • title - string
  • dateUpdated - datetime object
  • dateUploaded - datetime object
  • condition - string - 'new' or 'used'
  • hasShipping - boolean
  • freeShupping - boolean
  • otherProperties - dictionary containing all listing details

About

Python API for retrieving information from olx.ba

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages