https://github.com/fastestmolasses/pyopensea
Python SDK for the Opensea API
https://github.com/fastestmolasses/pyopensea
api blockchain crypto nft opensea python sdk stream
Last synced: about 1 year ago
JSON representation
Python SDK for the Opensea API
- Host: GitHub
- URL: https://github.com/fastestmolasses/pyopensea
- Owner: FastestMolasses
- License: mit
- Created: 2022-07-21T17:57:51.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-05T14:04:18.000Z (over 3 years ago)
- Last Synced: 2024-10-13T12:42:59.532Z (over 1 year ago)
- Topics: api, blockchain, crypto, nft, opensea, python, sdk, stream
- Language: Python
- Homepage:
- Size: 37.1 KB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Python SDK for the OpenSea API
[](https://badge.fury.io/py/py-opensea-sdk)

An unofficial Python SDK for the [OpenSea API](https://docs.opensea.io/reference/api-overview).
## Features
- Typing
- All endpoints supported
- Optional API key
- WebSocket support
## Installation
Requirements: Python 3.9+
```bash
pip install py-opensea-sdk
```
### Upgrade
```bash
pip install py-opensea-sdk -U
```
## Usage
```python
from pyopensea import OpenSeaAPI
# Create API instance
api = OpenSeaAPI('OPTIONAL-API-KEY')
# Examples
api.assets(owner='0x20481b79a4F03b624D214d23aDf5bF5f33bEB4aA')
api.contract('0x8a90cab2b38dba80c64b7734e58ee1db38b8992e')
api.listings('0x8a90cab2b38dba80c64b7734e58ee1db38b8992e', tokenID=10)
api.offers('0x8a90cab2b38dba80c64b7734e58ee1db38b8992e', tokenID=10, limit=5)
api.orders()
from datetime import datetime
# Note: datetime objects are automatically converted to the UTC timezone
api.orders('0x8a90cab2b38dba80c64b7734e58ee1db38b8992e',
listedAfter=datetime(2022, 7, 5))
api.events(occurredAfter=1658423412, occurredBefore=1658425412,
limit=1, eventType='successful')
# Note: datetime objects are automatically converted to the UTC timezone
api.events(occurredAfter=datetime(2022, 7, 3), occurredBefore=datetime(2022, 7, 5),
limit=1, eventType='successful')
# And more api endpoints supported...
```
## Contributing
1. Fork it ()
2. Create your feature branch (`git checkout -b feature/fooBar`)
3. Commit your changes (`git commit -am 'Add some fooBar'`)
4. Push to the branch (`git push origin feature/fooBar`)
5. Create a new Pull Request