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.MarketRegion.EU,
    bdomarket.ApiVersion.V2,
    bdomarket.Locale.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:")
utcdate = bdomarket.TimestampToDatetime(timestamp)
print(utcdate)
print(bdomarket.DatetimeToTimestamp(utcdate))

# -------------------------------
# 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())

# -------------------------------
# 10. Pig Cave Status
# -------------------------------
# Convert a Unix timestamp (in ms) to a human-readable format.
pigcavestatus = market.GetPigCaveStatus(bdomarket.PigCave.EU)
print(pigcavestatus)

# 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.18.tar.gz (39.9 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.18-py3-none-any.whl (37.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bdomarket-0.1.18.tar.gz
  • Upload date:
  • Size: 39.9 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.18.tar.gz
Algorithm Hash digest
SHA256 dc33b4a8da4258e1e22300000c080366188a7d65de7802d2374c31b8fde876e7
MD5 05c4a42426f088873f9b99c744c393ce
BLAKE2b-256 adb9dfbc72ca2a7e4294924ff70c52380ae056f599c4c87add45358512960b23

See more details on using hashes here.

Provenance

The following attestation bundles were made for bdomarket-0.1.18.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.18-py3-none-any.whl.

File metadata

  • Download URL: bdomarket-0.1.18-py3-none-any.whl
  • Upload date:
  • Size: 37.3 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.18-py3-none-any.whl
Algorithm Hash digest
SHA256 4ca39b05309b66480706471f5ee54bca9c490361d0f47ae6fa542cc0bb5ac51d
MD5 3fcee520289aedd5de592c4a7886c56e
BLAKE2b-256 e590b5ae54e4862b44c82bd5a809133bd45eadb20d1eb5f4bb8eabc0b8411cab

See more details on using hashes here.

Provenance

The following attestation bundles were made for bdomarket-0.1.18-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