eBay OAuth
What This Is
A Python CLI tool and library for eBay OAuth 2.0 Authorization Code Grant flow. Gets a refresh token, manages token lifecycle.
Related Projects
- ebay-mcp-server — MCP server for creating eBay listings via Claude. Depends on this package for auth.
Two Interfaces
- CLI —
ebay-oauth setupruns the full OAuth flow and gives you a refresh token - Library —
EbayOAuthClientprovidesget_access_token()with auto-refresh
Key Commands
poetry add ebay-oauth # or: pip install ebay-oauth
ebay-oauth setup # interactive OAuth flow
ebay-oauth status # check if token is valid
ebay-oauth refresh # force token refresh
Library Usage
from ebay_oauth import EbayOAuthClient
client = EbayOAuthClient(
client_id="...",
client_secret="...",
refresh_token="...",
environment="sandbox"
)
token = client.get_access_token() # auto-refreshes
Environment Variables
EBAY_CLIENT_IDEBAY_CLIENT_SECRETEBAY_REFRESH_TOKENEBAY_ENVIRONMENT(sandbox | production)
eBay OAuth Specifics
- Auth header:
Basic base64(client_id:client_secret) - Access token TTL: 2 hours
- Refresh token TTL: 18 months
- Sandbox token endpoint:
https://api.sandbox.ebay.com/identity/v1/oauth2/token - Production token endpoint:
https://api.ebay.com/identity/v1/oauth2/token - Sandbox consent:
https://auth.sandbox.ebay.com/oauth2/authorize - Production consent:
https://auth.ebay.com/oauth2/authorize
Deployment
- Local mode (default): localhost callback server, works for sandbox
- fly.io mode (
--remote): for production eBay apps that require HTTPS redirect URIs
Package Management
Uses Poetry for dependency management and publishing:
poetry install # install deps
poetry run pytest # run tests
poetry build # build wheel + sdist
poetry publish # publish to PyPI
Testing
poetry run pytest tests/
Tests mock eBay API responses. No real eBay calls in unit tests.
File Structure
ebay-oauth/
├── src/
│ └── ebay_oauth/
│ ├── __init__.py
│ ├── auth.py
│ ├── server.py
│ ├── cli.py
│ └── config.py
├── tests/
├── docs/
│ ├── architecture.html
│ ├── roadmap.html
│ └── user-story.html
├── fly.toml
├── pyproject.toml
└── CLAUDE.md
Metadata
Release files for ldraney-ebay-oauth 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ldraney_ebay_oauth-0.1.0.tar.gz | 6.9 kB | Without provenance | Details for ldraney_ebay_oauth-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ldraney_ebay_oauth-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for ldraney_ebay_oauth-0.1.0-py3-none-any.whl |
Total release size: 16.3 kB
Release files / ldraney_ebay_oauth-0.1.0.tar.gz
| Download URL | ldraney_ebay_oauth-0.1.0.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e38e9f26b90786a993f9c57c494e915b4e0ebbf839a69334c8f97367bd5ca14d
|
|
BLAKE2b-256 checksum How to use checksums |
ffc6d3a936643511e96149a0c04331597279eb8b9e022f3c07a90a92864a4507
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.4 CPython/3.13.7 Darwin/25.2.0
|
Release files / ldraney_ebay_oauth-0.1.0-py3-none-any.whl
| Download URL | ldraney_ebay_oauth-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
82e5cff5ec1e2934c4163b2497ee01fcc165d41fc37463ef6c649ca515bb2320
|
|
BLAKE2b-256 checksum How to use checksums |
ac1e1d1697111b7527ad764207a9baf59d1657ea14359e957ad764f7b9283e6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.4 CPython/3.13.7 Darwin/25.2.0
|
Security for ldraney-ebay-oauth 0.1.0
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.