Skip to main content

Prosper API client for Python

Python trading library for Prosper.com

GitHub Workflow Status (with event) PyPI - Version PyPI - Python Version PyPI - License Code Climate coverage Code Climate maintainability OpenSSF Best Practices GitHub commit activity (branch) GitHub issues

Installation

With Pip

pip install prosper-api

Optional keyring support

pip install 'prosper-api[secure]'

With Poetry

poetry add prosper-api

Optional keyring support

poetry add 'prosper-api[secure]'

Setup

ℹ️ The library currently only supports personal use, where the client id and credentials are from the same account. Support for multi-account mode is planned.

Config file location

  • Linux/Unix: $HOME/.config/prosper-api/config.toml
  • Windows: %HOMEDIR%%HOMEPATH\AppData\Local\prosper-api\prosper-api\config.toml
  • MacOs: $HOME/Library/Application Support/prosper-api/config.toml

Default

Create a config file with the following contents:

[credentials]
client-id = "0123456789abcdef0123456789abcdef"
client-secret = "fedcba9876543210fedcba9876543210"
username = "PROBABLY_YOUR_EMAIL_ADDRESS"
password = "AWESOME_PASSWORD"

More secure

ℹ️ You must have installed keyring or used the '[secure]' mode when installing the library.

Remove the client-secret and password portions of the config:

[credentials]
client-id = "0123456789abcdef0123456789abcdef"
username = "PROBABLY_YOUR_EMAIL_ADDRESS"

Run the following to store your credentials securely in your OS credentials storage, e.g. Keychain for MacOS, etc. For each command, you will be prompted to enter the corresponding secret. For 'CLIENT_ID', enter the client secret. For 'USERNAME' enter the corresponding password.

keyring set prosper-api '{CLIENT_ID}'
keyring set prosper-api '{USERNAME}'

Use

See a sample bot for concrete usage.

Get account details

The following will get the details of your account, including available cash and investment allocations.

from prosper_api.client import Client
from prosper_api.models import Account

client = Client()
account: Account = client.get_account_info()

Search listings

The following will get all the current listings you haven't invested in.

from prosper_api.client import Client
from prosper_api.models import Listing, SearchListingsRequest, SearchListingsResponse
from typing import List

PAGE_SIZE=25
client = Client()
listings: List[Listing] = []
offset = 0
while True:
    result: SearchListingsResponse = client.search_listings(SearchListingsRequest(invested=False, biddable=True, limit=PAGE_SIZE, offset=offset))
    listings += result.result
    offset += PAGE_SIZE
    if len(listings) >= result.total_count or len(result.result) < PAGE_SIZE:
        break

ℹ️ The full set of filters listed in the Prosper API docs are available

Place order

The following will place an order, given a listing id.

from prosper_api.client import Client
from prosper_api.models import Order

client = Client()
listing_id: int = 12341234
order_dollar_amount: float = 25
order_result: Order = client.order(listing_id, order_dollar_amount)

List notes

The following will list all the notes in your account. The same pattern can be used to list orders, loans, and payments.

from prosper_api.client import Client
from prosper_api.models import Note, ListNotesRequest, ListNotesResponse
from typing import List

client = Client()
notes: List[Note] = []
PAGE_SIZE = 25
offset = 0
while True:
    result: ListNotesResponse = client.list_notes(ListNotesRequest(limit=PAGE_SIZE, offset=offset, sort_by="age_in_months", sort_dir="asc"))
    notes += result.result
    offset += PAGE_SIZE
    if len(notes) >= result.total_count or len(result.result) < PAGE_SIZE:
        break

Configuration

Available config values:

["prosper-api.credentials.client-id"]
type = "str"
optional = false
constraint = "^[a-f0-9]{32}$"
description = "The client-id from Prosper."

["prosper-api.credentials.client-secret"]
type = "str"
optional = true
constraint = "^[a-f0-9]{32}$"
description = "The client-secret from Prosper; can be stored and accessed securely using the keyring library."

["prosper-api.credentials.username"]
type = "str"
optional = false
description = "Your Prosper username"

["prosper-api.credentials.password"]
type = "str"
optional = true
description = "Your Prosper password; can be stored and accessed securely using the keyring library."

["prosper-api.auth.token-cache"]
type = "str"
optional = false
default = "/Users/graham/Library/Caches/prosper-api/token-cache"
description = "The filesystem location where the auth token will be cached."

Feedback

This project uses GitHub issues for feature requests and bug reports.

Contributing

This project uses Poetry to manage dependencies and building. Follow the instructions to install it. Then use poetry install --all-extras to install the project dependencies. Then run poetry run autohooks activate to set up the pre-commit hooks. Please ensure the hooks pass before submitting a pull request.

Metadata

Release files for prosper-api 0.11.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prosper-api 0.11.2
File Size Uploaded Provenance Actions
prosper_api-0.11.2.tar.gz 22.1 kB Without provenance Details for prosper_api-0.11.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for prosper-api 0.11.2
File Interpreter ABI Platform Actions
prosper_api-0.11.2-py3-none-any.whl Python 3 none any Details for prosper_api-0.11.2-py3-none-any.whl

Total release size: 43.4 kB

Release files / prosper_api-0.11.2.tar.gz

Download URL prosper_api-0.11.2.tar.gz
Size 22.1 kB
Tags Source
SHA-256 checksum
How to use checksums
08f7dd04ebc6d99ff1b906083aef59523807daef2c6f5247a469d1321575734a
BLAKE2b-256 checksum
How to use checksums
a909a7f14927d6ce94f39759d4bff2794747422a6a6ecc9cc78117339e011373
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.13.2 Linux/6.8.0-1021-azure

Release files / prosper_api-0.11.2-py3-none-any.whl

Download URL prosper_api-0.11.2-py3-none-any.whl
Size 21.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ce26e5c186cfde38628669c72043d90cd089c271703c05a39a8a83432ed5ce8
BLAKE2b-256 checksum
How to use checksums
1feea22f5c8dc95bb405ceb47f195807bacebebf47ce7e517e4483eeb68f7c13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.13.2 Linux/6.8.0-1021-azure

Security for prosper-api 0.11.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.11.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page