{"id":18639084,"url":"https://github.com/zseta/python-opensea","last_synced_at":"2025-04-06T16:11:46.547Z","repository":{"id":39988730,"uuid":"425361181","full_name":"zseta/python-opensea","owner":"zseta","description":"Python wrapper for the OpenSea API","archived":false,"fork":false,"pushed_at":"2023-01-04T16:08:43.000Z","size":62,"stargazers_count":177,"open_issues_count":7,"forks_count":34,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-30T13:08:47.576Z","etag":null,"topics":["api","blockchain","crypto","nft","opensea","python","wrapper"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zseta.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-06T22:22:54.000Z","updated_at":"2024-12-20T05:08:17.000Z","dependencies_parsed_at":"2023-02-02T18:18:45.747Z","dependency_job_id":null,"html_url":"https://github.com/zseta/python-opensea","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zseta%2Fpython-opensea","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zseta%2Fpython-opensea/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zseta%2Fpython-opensea/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zseta%2Fpython-opensea/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zseta","download_url":"https://codeload.github.com/zseta/python-opensea/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247509223,"owners_count":20950232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","blockchain","crypto","nft","opensea","python","wrapper"],"created_at":"2024-11-07T05:45:00.407Z","updated_at":"2025-04-06T16:11:46.519Z","avatar_url":"https://github.com/zseta.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenSea NFT API Python 3 wrapper\nThis an API wrapper library for the [OpenSea API](https://docs.opensea.io/reference/api-overview) written in Python 3.\n\nThe library provides a simplified interface to fetch a diverse set of NFT data points from OpenSea. \n\n## Supported endpoints\nThe wrapper covers the following OpenSea API endpoints:\n\n* Single asset ([/asset](https://docs.opensea.io/reference/retrieving-a-single-asset))\n* Single asset contract ([/asset_contract](https://docs.opensea.io/reference/retrieving-a-single-contract))\n* Single collection ([/collection](https://docs.opensea.io/reference/retrieving-a-single-collection))\n* Collection stats ([/collection/{slug}/stats](https://docs.opensea.io/reference/retrieving-collection-stats))\n* Multiple assets] ([/assets](https://docs.opensea.io/reference/getting-assets))\n* Multiple collections ([/collections](https://docs.opensea.io/reference/retrieving-collections))\n* Multiple events ([/events](https://docs.opensea.io/reference/retrieving-asset-events))\n* Multiple bundles ([/bundles](https://docs.opensea.io/reference/retrieving-bundles))\n* Asset listings ([/asset/{asset_contract_address}/{token_id}/listings](https://docs.opensea.io/reference/asset-listings))\n* Asset offers ([/asset/{asset_contract_address}/{token_id}/offers](https://docs.opensea.io/reference/asset-offers))\n\n\n## Prerequisite\nYou need to have an **API key** to use the OpenSea API, and thus\nyou need one to use this wrapper too. [You can request a key here.](https://docs.opensea.io/reference/request-an-api-key) \u003cbr\u003e\u003cbr\u003e\nNOTE: The API key can take over 4-7 days to be delivered. It also requires you to show the project you are working on. \n\n## Installation\nInstall with pip:\n```bash\nvirtualenv env \u0026\u0026 source env/bin/activate\npip install opensea-api\n```\n\n### Upgrade\n```bash\npip install opensea-api -U\n```\n\n## Usage examples\n\n```python\n# import the OpenseaAPI object from the opensea module\nfrom opensea import OpenseaAPI\n\n# create an object to interact with the Opensea API (need an api key)\napi = OpenseaAPI(apikey=\"YOUR APIKEY\")\n\n# fetch a single asset\ncontract_address = \"0x495f947276749Ce646f68AC8c248420045cb7b5e\"\ntoken_id = \"66406747123743156841746366950152533278033835913591691491127082341586364792833\"\nresult = api.asset(asset_contract_address=contract_address, token_id=token_id)\n\n# fetch multiple assets\nresult = api.assets(owner=\"0xce90a7949bb78892f159f428d0dc23a8e3584d75\", limit=3)\n\n# fetch a single contract\nresult = api.contract(asset_contract_address=\"0x495f947276749Ce646f68AC8c248420045cb7b5e\")\n\n# fetch a single collection\nresult = api.collection(collection_slug=\"cryptopunks\")\n\n# fetch multiple collections\nresult = api.collections(asset_owner=\"0xce90a7949bb78892f159f428d0dc23a8e3584d75\", limit=3)\n\n# fetch collection stats\nresult = api.collection_stats(collection_slug=\"cryptopunks\")\n\n# fetch multiple events\nfrom opensea import utils as opensea_utils\n\nperiod_end = opensea_utils.datetime_utc(2021, 11, 6, 14, 30)\nresult = api.events(\n    occurred_before=period_end,\n    limit=10,\n    export_file_name=\"events.json\",\n)\n\n# fetch multiple bundles\nresult = api.bundles(limit=2)\n\n# paginate the events endpoint (cursors are handled internally)\nfrom datetime import datetime, timezone\n\nstart_at = datetime(2021, 10, 5, 3, 25, tzinfo=timezone.utc)\nfinish_at = datetime(2021, 10, 5, 3, 20, tzinfo=timezone.utc)\n\nevent_generator = api.events_backfill(start=start_at,\n                                      until=finish_at,\n                                      event_type=\"successful\")\nfor event in event_generator:\n    if event is not None:\n        print(event) # or do other things with the event data\n```\n\n[Here's a demo video showcasing the basics.](https://www.youtube.com/watch?v=ga4hTqNRjfw)\n\n## Documentation\n* [Wrapper documentation](https://opensea-api.attilatoth.dev)\n* [OpenSea API documentation](https://docs.opensea.io/reference/api-overview)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzseta%2Fpython-opensea","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzseta%2Fpython-opensea","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzseta%2Fpython-opensea/lists"}