Skip to main content

API client for BDO market

Project description

Contributors Forks Stargazers Issues project_license discord


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.
  • Regional Pig Cave Status: Easily fetch pig cave status for different regions.

(back to top)

Donate

If you like my project, you can buy me a coffee, many thanks ❤️ !

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

Installation

pip install bdomarket

(back to top)

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!")

(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
    • 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.2.5.tar.gz (42.2 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.2.5-py3-none-any.whl (39.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for bdomarket-0.2.5.tar.gz
Algorithm Hash digest
SHA256 d4bdd30e213e0ad093bd36e8f571ab6d818c12bd5b85e21863a969163b6417c7
MD5 f3f0a50ec224c4dc4d08715970d52a7b
BLAKE2b-256 7b973a545ca859f6fa0051180f3f359831658b4f41cc38e99f71824327afac8d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bdomarket-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 39.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.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e39f15b5e6d26c4dda4a4aa19c9193b073b70fcc68dd592bcfb395f9008dd589
MD5 cb16cdf0632f7022c737c1bab6e961c3
BLAKE2b-256 0457697a60ca56996b81d1d91c961baa26e2b9bae7c01adef1ed1f4fd4086c96

See more details on using hashes here.

Provenance

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