Skip to content

Zero3141/WgGesuchtAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WgGesuchtAPI

An inofficial API client for wg-gesucht.de. Not affiliated with SMP GmbH & Co. KG

Installation

Copy wgGesuchtClient.py from core folder and import it to target file.

Usage

Login

Login with username/email and password:

from wgGesuchtClient import WgGesuchtClient
client = WgGesuchtClient()
if client.login('username', 'password'):
  account = client.exportAccount()

The account object contains userId, accessToken, refreshToken, phpSession, devRefNo. Use this object for importAccount method to re-use session.

Re-use session

Use previous account session. If the accessToken is expired we automatically try to refresh with the refreshToken.

account = json.loads(jsonAccount)
client.importAccount(account)

The client is now ready to use

API methods

Endpoints can only be used with valid session. As described in Re-use session, the accessToken is refreshed if required in every request.

Method Parameters Response
login username: str, password: str True
refreshToken - True
myProfile - Profile json object
findCity query: str City array
offers cityId: str, categories: str, maxRent: str, minSize: str, page: str = '1' Offers array
offerDetail offerId: str Offer detail object
contactOffer offerId: str, message: str All conversation messanges in thread
conversations page: str = '1' Conversation threads array
conversationDetail conversationId: str Conversation object

If a request failes, False is returned.

Examples

Sample usages are located in examples folder:

  • Authentication in authExample.py
  • Offer in offerExample.py

About

A simple API client for wg-gesucht.de

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages