Skip to main content

API client for BDO market

Project description

Contributors Forks Stargazers Issues project_license


Logo

bdomarket

API client for BDO market data

PyPI · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

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 ApiResponse object, 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.

(back to top)

Built With

Python

(back to top)

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.8

Installation

pip install bdomarket

(back to top)

Usage

import bdomarket

# -------------------------------
# 1. Initialize Market Interface
# -------------------------------
# Set up the market object for the EU region, API version 2, and English language.
market = bdomarket.Market(
    bdomarket.AvailableRegions.EU,
    bdomarket.AvailableApiVersions.V2,
    bdomarket.SupportedLanguages.English
)

# -------------------------------
# 2. Boss Timer Functionality
# -------------------------------
# Fetch and display world boss spawn times for the EU server.
boss_timer = bdomarket.timers.Boss(bdomarket.timers.Server.EU).Scrape()
print("Boss Timer (Python object):")
print(boss_timer.GetTimer())
print("\nBoss Timer (JSON):")
print(boss_timer.GetTimerJSON())

# -------------------------------
# 3. Market Wait List
# -------------------------------
# Retrieve the current market waitlist and save it to a file.
waitlist_response = market.GetWorldMarketWaitList()
print("\nMarket Wait List (content):")
print(waitlist_response.content)
waitlist_response.SaveToFile("responses/waitlist/get.json")

# Deserialize waitlist to Python objects and print each item.
print("\nDeserialized Wait List Items:")
for item in waitlist_response.Deserialize():
    print(item)

# -------------------------------
# 4. Item Queries
# -------------------------------
# Fetch information for multiple items by their IDs and save to file.
item_ids = ["3", "9505", "14870"]
items_response = market.GetItem(item_ids)
items_response.SaveToFile("responses/items/get.json")
print("\nFetched Items:")
print(items_response.content)

# Dump a range of items (IDs 0 to 250) to a file.
market.ItemDatabaseDump(0, 250).SaveToFile("responses/itemdump/dump.json")

# -------------------------------
# 5. Market Lists and SubLists
# -------------------------------
# Get and save various market lists.
market.GetWorldMarketList("1", "1").SaveToFile("responses/list/get.json")
market.GetWorldMarketSubList(["735008", "731109"]).SaveToFile("responses/sublist/get.json")
market.GetWorldMarketSearchList(["735008", "731109"]).SaveToFile("responses/searchlist/get.json")

# -------------------------------
# 6. Bidding and Price Info
# -------------------------------
# Fetch and save bidding and price information for specific items.
# NOTE: Timestamp Conversion Utility is used to convert Unix timestamps to human-readable format.
market.GetBiddingInfo(["735008", "731109"], ["19", "20"]).SaveToFile("responses/bidding/get.json")
market.GetMarketPriceInfo(["735008", "731109"], ["19", "20"]).SaveToFile("responses/priceinfo/get.json")

# -------------------------------
# 7. Pearl Items and Market Info
# -------------------------------
# Retrieve and save pearl shop items and overall market info.
market.GetPearlItems().SaveToFile("responses/pearlitems/get.json")
market.GetMarket().SaveToFile("responses/market/get.json")

# -------------------------------
# 8. Timestamp Conversion Utility
# -------------------------------
# Convert a Unix timestamp (in ms) to a human-readable format.
timestamp = 1745193600000
print("\nConverted Timestamp:")
print(bdomarket.ConvertTimestamp(timestamp))

# -------------------------------
# 9. Item Object Usage
# -------------------------------
# Create an Item object, print its details, and download its icon.
item = bdomarket.item.Item()
print("\nItem Object:")
print(item)
print("Item as dict:", item.to_dict())

# Download the item's icon by ID (absolute path) and by name (relative path).
item.GetIcon(r"D:\bdomarket\icons", False, bdomarket.item.ItemProp.ID)
item.GetIcon("icons", True, bdomarket.item.ItemProp.NAME)

(back to top)

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
    • Caching of frequent API responses
    • 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).

(back to top)

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:

contrib.rocks image

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.

Learn more about GPL-3.0 »

(back to top)

Contact

Project Link: https://github.com/Fizzor96/bdomarket

(back to top)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bdomarket-0.1.16.tar.gz (39.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bdomarket-0.1.16-py3-none-any.whl (37.0 kB view details)

Uploaded Python 3

File details

Details for the file bdomarket-0.1.16.tar.gz.

File metadata

  • Download URL: bdomarket-0.1.16.tar.gz
  • Upload date:
  • Size: 39.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for bdomarket-0.1.16.tar.gz
Algorithm Hash digest
SHA256 e662315ca68fe14bb3a712ba42350f4afb3e3659b73c6ec8eb77316a99a03513
MD5 58c66deaad8ea184e2d8a375a04fce2a
BLAKE2b-256 da261edb0269d9f6d22aa8d828c17133f530f8e56efa452c5faac9f1480b3c9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for bdomarket-0.1.16.tar.gz:

Publisher: release.yml on Fizzor96/bdomarket

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bdomarket-0.1.16-py3-none-any.whl.

File metadata

  • Download URL: bdomarket-0.1.16-py3-none-any.whl
  • Upload date:
  • Size: 37.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for bdomarket-0.1.16-py3-none-any.whl
Algorithm Hash digest
SHA256 eb6a665113265d1d583b0d2a00f6e0a9aebabe9bb0788307413b9450545f17c4
MD5 e6502de4aa73980aeeed84adde41d85f
BLAKE2b-256 864d70ef751993f46e77fbb53a55d03c3bdb7e4bf8dc7dbc078daaac4ce4739f

See more details on using hashes here.

Provenance

The following attestation bundles were made for bdomarket-0.1.16-py3-none-any.whl:

Publisher: release.yml on Fizzor96/bdomarket

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page