Bungie API Python Wrapper
This is a work in progress python wrapper for the Bungie API.
MIT License
Test Information
❌ Complete API coverage.
✔️ OAuth workflow
✔️ Token endpoints (access token, refresh token)
✔️ OAuth context for endpoints requiring it.
❌ Endpoints
✔️ App
✔️ User
❌ Content
❌ Forum
❌ GroupV2
❌ Tokens
❌ Destiny2
❌ CommunityContent
❌ Trending
❌ Fireteam
❌ Social
❌ Common
❌ Entity Models
✔️ Async and sync client implementations.
A simple synchronous usage example:
import bungie_api_python
from bungie_api_python .entities .core import OAuthClientType
# Anything beyond the api key is optional,
# and only required for endpoints that use OAuth
client = bungie_api_python .BungieClientSync (
api_key = 'your_key' ,
client_id = 000 ,
client_secret = 'client_secret' ,
client_type = OAuthClientType .Confidential
)
# Non OAuth endpoints will work right away
apps = client .app .get_bungie_applications ()
for app in apps .Response :
print (f'{ app .name } : { app .status } ' )
# >>> www.bungie.net: ApplicationStatus.Private
# >>> Destiny 2 Companion (Android): ApplicationStatus.Private
# etc...
# If using OAuth, passing in an authorization code will perform the token
# exchange process, and refresh the token as necessary.
client .gen_oauth_context (code = 'your auth code' )
user = client .user .get_membership_data_for_current_user ()
print (user .Response .bungieNetUser .uniqueName )
# >>> "Aryathel#7877"
The same process can be used for an asynchronous client.
Simply create a BungieClientAsync
instance rather than a BungeClientSync
instance, then await
your calls (await client.gen_oauth_context
, await client.user.get_bungie_applications
, etc.).
All endpoint methods are accessed via the respective client.
client = BungieClientSync(...)
then client.<collection>.<method>
client.oauth.get_access_token
Endpoint
Method
Implemented
Tested
Comments
GetAccessToken
oauth.get_access_token
✔️
✔️
GetRefreshToken
oauth.refresh_access_token
✔️
✔️
Endpoint
Implemented
Tested
Comments
GetContentType
❌
❌
GetContentById
❌
❌
GetContentByTagAndType
❌
❌
SearchContentWithText
❌
❌
SearchContentByTagAndType
❌
❌
SearchHelpArticles
❌
❌
RssNewsArticles
❌
❌
Endpoint
Implemented
Tested
Comments
GetTopicsPaged
❌
❌
GetCoreTopicsPaged
❌
❌
GetPostsThreadedPaged
❌
❌
GetPostsThreadedPagedFromChild
❌
❌
GetPostAndParent
❌
❌
GetPostAndParentAwaitingApproval
❌
❌
GetTopicForContent
❌
❌
GetForumTagSuggestions
❌
❌
GetPoll
❌
❌
GetRecruitmentThreadSummaries
❌
❌
Endpoint
Implemented
Tested
Comments
GetAvailableAvatars
❌
❌
GetAvailableThemes
❌
❌
GetUserClanInviteSetting
❌
❌
GetRecommendedGroups
❌
❌
GroupSearch
❌
❌
GetGroup
❌
❌
GetGroupByName
❌
❌
GetGroupByNameV2
❌
❌
GetGroupOptionalConversations
❌
❌
EditGroup
❌
❌
EditClanBanner
❌
❌
EditFounderOptions
❌
❌
AddOptionalConversation
❌
❌
EditOptionalConversation
❌
❌
GetMembersOfGroup
❌
❌
GetAdminsAndFounderOfGroup
❌
❌
EditGroupMembership
❌
❌
KickMember
❌
❌
BanMember
❌
❌
UnbanMember
❌
❌
GetBannedMembersOfGroup
❌
❌
AbdicateFoundership
❌
❌
GetPendingMemberships
❌
❌
GetInvitedIndividuals
❌
❌
ApproveAllPending
❌
❌
DenyAllPending
❌
❌
ApprovePendingForList
❌
❌
ApprovePending
❌
❌
DenyPendingForList
❌
❌
GetGroupsForMember
❌
❌
RecoverGroupForFounder
❌
❌
GetPotentialGroupsForMember
❌
❌
IndividualGroupInvite
❌
❌
IndividualGroupInviteCancel
❌
❌
Endpoint
Implemented
Tested
Comments
ForceDropsRepair
❌
❌
ClaimPartnerOffer
❌
❌
ApplyMissingPartnerOffersWithoutClaim
❌
❌
GetPartnerOfferSkuHistory
❌
❌
GetPartnerRewardHistory
❌
❌
GetBungieRewardsForUser
❌
❌
GetBungieRewardsForPlatformUser
❌
❌
GetBungieRewardsList
❌
❌
Endpoint
Implemented
Tested
Comments
GetDestinyManifest
❌
❌
GetDestinyEntityDefinition
❌
❌
SearchDestinyPlayerByBungieName
❌
❌
GetLinkedProfiles
❌
❌
GetProfile
❌
❌
GetCharacter
❌
❌
GetClanWeeklyRewardState
❌
❌
GetClanBannerSource
❌
❌
GetItem
❌
❌
GetVendors
❌
❌
GetVendor
❌
❌
GetPublicVendors
❌
❌
GetCollectibleNodeDetails
❌
❌
TransferItem
❌
❌
PullFromPostmaster
❌
❌
EquipItem
❌
❌
EquipItems
❌
❌
SetItemLockState
❌
❌
SetQuestTrackedState
❌
❌
InsertSocketPlug
❌
❌
InsertSocketPlugFree
❌
❌
GetPostGameCarnageReport
❌
❌
ReportOffensivePostGameCarnageReportPlayer
❌
❌
GetHistoricalStatsDefinition
❌
❌
GetClanLeaderboards
❌
❌
GetClanAggregateStats
❌
❌
GetLeaderboards
❌
❌
GetLeaderboardsForCharacter
❌
❌
SearchDestinyEntities
❌
❌
GetHistoricalStats
❌
❌
GetHistoricalStatsForAccount
❌
❌
GetActivityHistory
❌
❌
GetUniqueWeaponHistory
❌
❌
GetDestinyAggregateActivityStats
❌
❌
GetPublicMilestoneContent
❌
❌
GetPublicMilestones
❌
❌
AwaInitializeRequest
❌
❌
AwaProvideAuthorizationResult
❌
❌
AwaGetActionToken
❌
❌
CommunityContent Endpoint
Endpoint
Implemented
Tested
Comments
GetCommunityContent
❌
❌
Endpoint
Implemented
Tested
Comments
GetTrendingCategories
❌
❌
GetTrendingCategory
❌
❌
GetTrendingEntryDetail
❌
❌
Endpoint
Implemented
Tested
Comments
GetActivePrivateClanFireteamCount
❌
❌
GetAvailableClanFireteams
❌
❌
SearchPublicAvailableClanFireteams
❌
❌
GetMyClanFireteams
❌
❌
GetClanFireteam
❌
❌
Endpoint
Implemented
Tested
Comments
GetFriendList
❌
❌
GetFriendRequestList
❌
❌
IssueFriendRequest
❌
❌
AcceptFriendRequest
❌
❌
DeclineFriendRequest
❌
❌
RemoveFriend
❌
❌
RemoveFriendRequest
❌
❌
GetPlatformFriendList
❌
❌
Endpoint
Implemented
Tested
Comments
GetAvailableLocales
❌
❌
GetCommonSettings
❌
❌
GetUserSystemOverrides
❌
❌
GetGlobalAlerts
❌
❌
I plan to create a separate package specifically for integrating with the
Destiny manifest, which will utilize this package as a dependency.