API client for BDO market
Project description
Table of Contents
About The Project
This code is a simple and well-structured API client for BDO market data, built for convenience. It enables developers to access market information, price history, and shop data from Arsha.io in a standardized way.
Features
- Market Data Access: Retrieve real-time and historical data from the BDO Central Market, including waitlists, hotlists, item lists, sublists, search results, bidding info, and price info.
- Boss Timers: Easily fetch and display world boss spawn times for different servers and regions.
- Item Management: Query single or multiple items by ID, dump large ranges of item data, and work with item objects that support conversion to dictionaries and icon downloading.
- API Response Handling: All API calls return a standardized
ApiResponseobject, making it easy to access content, status codes, and success flags, as well as to deserialize responses into Python objects. - Data Export: Save any API response directly to a file in JSON format for later analysis or debugging.
- Timestamp Conversion: Convert Unix timestamps from API responses into human-readable date and time strings.
- Multi-Region and Multi-Language Support: Easily switch between different BDO regions (EU, NA, etc.) and supported languages.
- Convenient Utilities: Download item icons, print readable representations of items, and more.
- Regional Pig Cave Status: Easily fetch pig cave status for different regions.
Donate
If you like my project, you can buy me a coffee, many thanks ❤️ !
Built With
Getting Started
A Python API client for accessing the Arsha.io Black Desert Online Market API.
Easily retrieve market data, hotlist items, price history, bidding info, and more.
Prerequisites
Python installed on your system.
- Python >= 3.9
Installation
pip install bdomarket
Usage
import asyncio
import bdomarket as bm
async def main():
# Initialize Market with EU region, V2 API, English locale
async with bm.Market(region=bm.MarketRegion.EU, api_version=bm.ApiVersion.V2, language=bm.Locale.English) as market:
# Get world market wait list
wait_list = await market.get_world_market_wait_list()
# print("World Market Wait List:", wait_list)
wait_list.save_to_file("responses/waitlist/get.json")
# Post world market wait list
post_wait_list = await market.post_world_market_wait_list()
# print("Post World Market Wait List:", post_wait_list)
post_wait_list.save_to_file("responses/waitlist/post.json")
# Get world market hot list
hot_list = await market.get_world_market_hot_list()
# print("World Market Hot List:", hot_list)
hot_list.save_to_file("responses/hotlist/get.json")
# Post world market hot list
post_hot_list = await market.post_world_market_hot_list()
# print("Post World Market Hot List:", post_hot_list)
post_hot_list.save_to_file("responses/hotlist/post.json")
# Get market price info for items
price_info = await market.get_market_price_info(ids=["735008", "735009"], sids=["20", "20"], convertdate=True, formatprice=False)
# print("Market Price Info:", price_info)
price_info.save_to_file("responses/priceinfo/get.json")
# Post market price info
post_price_info = await market.post_market_price_info(ids=["735008", "735009"], sids=["20", "20"], convertdate=True, formatprice=False)
# print("Post Market Price Info:", post_price_info)
post_price_info.save_to_file("responses/priceinfo/post.json")
# Get world market search list
search_list = await market.get_world_market_search_list(ids=["735008"])
# print("World Market Search List:", search_list)
search_list.save_to_file("responses/searchlist/get.json")
# Post world market search list
post_search_list = await market.post_world_market_search_list(ids=["735008"])
# print("Post World Market Search List:", post_search_list)
post_search_list.save_to_file("responses/searchlist/post.json")
# Get world market list by category
market_list = await market.get_world_market_list(main_category="1", sub_category="1")
# print("World Market List:", market_list)
market_list.save_to_file("responses/marketlist/get.json")
# Post world market list
post_market_list = await market.post_world_market_list(main_category="1", sub_category="1")
# print("Post World Market List:", post_market_list)
post_market_list.save_to_file("responses/marketlist/post.json")
# Get world market sub list
sub_list = await market.get_world_market_sub_list(ids=["735008"])
# print("World Market Sub List:", sub_list)
sub_list.save_to_file("responses/sublist/get.json")
# Post world market sub list
post_sub_list = await market.post_world_market_sub_list(ids=["735008"])
# print("Post World Market Sub List:", post_sub_list)
post_sub_list.save_to_file("responses/sublist/post.json")
# Get bidding info
bidding_info = await market.get_bidding_info(ids=["735008", "735009"], sids=["20", "20"])
# print("Bidding Info:", bidding_info)
bidding_info.save_to_file("responses/biddinginfo/get.json")
# Post bidding info
post_bidding_info = await market.post_bidding_info(ids=["735008", "735009"], sids=["20", "20"])
# print("Post Bidding Info:", post_bidding_info)
post_bidding_info.save_to_file("responses/biddinginfo/post.json")
# Get pearl items
pearl_items = await market.get_pearl_items()
# print("Pearl Items:", pearl_items)
pearl_items.save_to_file("responses/pearlitems/get.json")
# Post pearl items
post_pearl_items = await market.post_pearl_items()
# print("Post Pearl Items:", post_pearl_items)
post_pearl_items.save_to_file("responses/pearlitems/post.json")
# Get market
# ! BROKEN
market_data = await market.get_market()
# print("Market Data:", market_data)
market_data.save_to_file("responses/marketdata/get.json")
# Post market
# ! BROKEN
post_market_data = await market.post_market()
# print("Post Market Data:", post_market_data)
post_market_data.save_to_file("responses/marketdata/post.json")
# Get item by ID
item = await market.get_item(ids=["735008"])
# print("Item Info:", item)
item.save_to_file("responses/item/get.json")
# Get item database dump
item_dump = await market.item_database_dump(start_id=1, end_id=10, chunk_size=5)
# print("Item Database Dump:", item_dump)
item_dump.save_to_file("responses/itemdump/get.json")
# Get Pig Cave status
pig_cave = await market.get_pig_cave_status(region=bm.PigCave.EU)
# print("Pig Cave Status:", pig_cave)
pig_cave.save_to_file("responses/pig/get.json")
# Get world boss timer
bosstimer = bm.Boss().Scrape()
bosstimer.GetTimer()
bosstimer.GetTimerJSON()
item = bm.Item(id="735008")
# item.GetIcon(r"C:\yourpath", False, ItemProp.ID)
item.GetIcon("responses/icons", True, bm.ItemProp.NAME)
item.GetIcon("responses/icons", True, bm.ItemProp.ID)
if __name__ == "__main__":
print("Loading...")
asyncio.run(main())
print("Done!")
Roadmap
- Market Data Access
- Retrieve real-time market data
- Retrieve historical market data
- Get waitlists, hotlists, item lists, sublists, and search results
- Boss Timers
- Fetch world boss spawn times for all supported servers and regions
- Item Management
- Query single or multiple items by ID
- Dump large ranges of item data
- Item object conversion to dictionary
- Download item icons
- Searching items by name or ID in DBdump?
- API Response Handling
- Standardized ApiResponse object for all API calls
- Deserialize responses into Python objects
- Data Export
- Save API responses to JSON files
- Timestamp Conversion
- Convert Unix timestamps to human-readable format
- Multi-Region and Multi-Language Support
- Switch between BDO regions
- Switch between supported languages
- Utilities
- Print readable representations of items
- Additional helper functions
- Error Handling & Robustness
- Graceful handling of network/API errors
- Retry logic for failed requests
- Logging for debugging and monitoring
- Documentation
- Comprehensive API documentation
- Usage examples and tutorials
- Docstrings for all public classes and methods
- Testing
- Unit tests for core functionality
- Integration tests for API endpoints
- Search & Filtering
- Search items by name or partial match
- Filter market data by category, price, etc.
- Performance Improvements
- Async support for faster data retrieval
- CLI Tool
- Command-line interface for quick queries and downloads
- Webhook/Notification Support
- Notify users of market changes or boss
See the open issues for a full list of proposed features (and known issues).
Example:
market.GetBiddingInfo(["735008", "731109"], ["19", "20"]).SaveToFile("responses/bidding/get.json")
Outputs:
{
"success": true,
"statuscode": 200,
"message": "No message provided",
"content": [
{
"name": "Blackstar Shuriken",
"id": 735008,
"sid": 19,
"orders": [
{
"price": 14500000000,
"sellers": 1,
"buyers": 0
},
{
"price": 15500000000,
"sellers": 1,
"buyers": 0
},
{
"price": 14900000000,
"sellers": 4,
"buyers": 0
},
{
"price": 14700000000,
"sellers": 0,
"buyers": 0
}
]
},
{
"name": "Blackstar Sura Katana",
"id": 731109,
"sid": 20,
"orders": [
{
"price": 72500000000,
"sellers": 1,
"buyers": 0
},
{
"price": 73500000000,
"sellers": 1,
"buyers": 0
},
{
"price": 73000000000,
"sellers": 1,
"buyers": 0
},
{
"price": 70500000000,
"sellers": 0,
"buyers": 0
}
]
}
]
}
Top contributors:
License
Distributed under the GNU General Public License v3.0.
See LICENSE for more information.
This project is copyleft: you may copy, distribute, and modify it under the terms of the GPL, but derivative works must also be open source under the same license.
Contact
Project Link: https://github.com/Fizzor96/bdomarket
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bdomarket-0.2.4.tar.gz.
File metadata
- Download URL: bdomarket-0.2.4.tar.gz
- Upload date:
- Size: 41.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b50bc01a5bfd3095b085e81dc84dd016ff101b5549c7f89d69a5f1a1e55abdd8
|
|
| MD5 |
32a30d3247c767ba7274e09e6e777829
|
|
| BLAKE2b-256 |
eccfdb3d00e97ea590105b94372d33e7339552c4e84186980470e1b2900a9c66
|
Provenance
The following attestation bundles were made for bdomarket-0.2.4.tar.gz:
Publisher:
release.yml on Fizzor96/bdomarket
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bdomarket-0.2.4.tar.gz -
Subject digest:
b50bc01a5bfd3095b085e81dc84dd016ff101b5549c7f89d69a5f1a1e55abdd8 - Sigstore transparency entry: 291386335
- Sigstore integration time:
-
Permalink:
Fizzor96/bdomarket@93b44e647184dbb869bc451fd651def9f7613eda -
Branch / Tag:
refs/tags/0.2.4 - Owner: https://github.com/Fizzor96
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@93b44e647184dbb869bc451fd651def9f7613eda -
Trigger Event:
push
-
Statement type:
File details
Details for the file bdomarket-0.2.4-py3-none-any.whl.
File metadata
- Download URL: bdomarket-0.2.4-py3-none-any.whl
- Upload date:
- Size: 38.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ccc481e019882de25efdd612bef097acf7d1ffea45d5d4173d051d8a1cac0e1
|
|
| MD5 |
edac2fab1801cd4ad840d71d7e6df319
|
|
| BLAKE2b-256 |
22469ec05cf380b16330757b96039013e206a84db973f5364e3fc0a76ac3d020
|
Provenance
The following attestation bundles were made for bdomarket-0.2.4-py3-none-any.whl:
Publisher:
release.yml on Fizzor96/bdomarket
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bdomarket-0.2.4-py3-none-any.whl -
Subject digest:
6ccc481e019882de25efdd612bef097acf7d1ffea45d5d4173d051d8a1cac0e1 - Sigstore transparency entry: 291386366
- Sigstore integration time:
-
Permalink:
Fizzor96/bdomarket@93b44e647184dbb869bc451fd651def9f7613eda -
Branch / Tag:
refs/tags/0.2.4 - Owner: https://github.com/Fizzor96
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@93b44e647184dbb869bc451fd651def9f7613eda -
Trigger Event:
push
-
Statement type: