Code Monkey home page Code Monkey logo

apex-legends-api's Introduction

apex-legends-api

Python wrapper for https://apexlegendsapi.com

Downloads

Installation

You can install it from source, or pip (recommended)

Requirements

python >= 3.9

Source installation

python ./setup.py install

Pip installation

pip install apex-legends-api

Usage

  • Register for an API Key at Apex Legends API
  • Here's a quick snippet to get started
  • All method calls return a dictionary representing the JSON in the response.
import sys
from apex_legends_api import ApexLegendsAPI,\
    ALPlatform,\
    ALPlayer,\
    ALAction,\
    ALHTTPExceptionFromResponse
from apex_legends_api.al_base import print_description

api = ApexLegendsAPI(api_key='<api_key>')

player_name = str("PlayerName")
player_uid = str("1234567890")
platform = ALPlatform.PC
action = ALAction.GET

# Example 1:
# straight API calls
try:
    basic = api.basic_player_stats(player_name=player_name, platform=platform)
    # or query by UID
    # basic = api.basic_player_stats_by_uid(uid=player_uid, platform=platform)
    history = api.events(player_name=player_name, platform=platform, action=action)
    origin_player = api.get_player_origin(player_name=player_name, show_all_hits=True)
except ALHTTPExceptionFromResponse as exception:
    print(exception)
    sys.exit()

print(basic)
print(history)
print(origin_player)

# Example 2:
# retrieve an 'ALPlayer' object
player: ALPlayer = api.get_player(name=player_name, platform=platform)
print_description(player)

Notes

apex-legends-api's People

Contributors

dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

erikbatho

apex-legends-api's Issues

Error running unit tests from CondensedTea PR

test setup failed
@pytest.fixture()
    def basic_player_stats_response():
>       with open('tests/responses/basic_player_stats_response.json') as json_file:
E       FileNotFoundError: [Errno 2] No such file or directory: 'tests/responses/basic_player_stats_response.json'

conftest.py:14: FileNotFoundError

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.