Add gold and silver commodity endpoints#390
Open
Jackisome wants to merge 1 commit into
Open
Conversation
Jackisome
force-pushed
the
add-gold-silver-commodities
branch
from
June 21, 2026 17:12
34b209a to
ecd5b84
Compare
Author
|
I noticed that #387 already implements the historical gold/silver endpoint via I have updated this PR to align with that package API style instead of the earlier
So there is still overlap with #387 on the historical endpoint, but this PR additionally covers the realtime spot endpoint and adds tests for both history and spot behavior, including If maintainers prefer #387 as the base, I am happy to adjust this PR further to contribute only the spot support and tests. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds wrappers for the official Alpha Vantage gold/silver endpoints in
Commodities, aligned with the existing commodity method style (get_wti(),get_copper(), etc.):Historical series:
get_gold(interval="monthly", symbol="GOLD")->GOLD_SILVER_HISTORYget_silver(interval="monthly", symbol="SILVER")->GOLD_SILVER_HISTORYRealtime spot prices:
get_gold_spot(symbol="GOLD")->GOLD_SILVER_SPOTget_silver_spot(symbol="SILVER")->GOLD_SILVER_SPOTThe official docs accept:
GOLD/XAUSILVER/XAGHistorical intervals are documented as:
dailyweeklymonthlyRelationship to #387
This PR overlaps with #387 on the historical endpoint (
GOLD_SILVER_HISTORY). I updated this PR to follow the same package-style API direction as #387 (get_gold()/get_silver()), while also adding:get_gold_spot()/get_silver_spot())XAU/XAGsymbol coverage in testsIf maintainers prefer #387 as the base implementation, I am happy to adapt this PR to contribute only the missing spot endpoint support and tests.
Context
This follows up on the previously closed #385. The duplicate follow-up issue #389 was closed in favor of this implementation PR.
The official API supports these endpoints, but they were not exposed through the Python wrapper. Using
ForeignExchange/FX_DAILYis not a substitute for XAG/USD or XAU/USD, because gold/silver are handled by the dedicatedGOLD_SILVER_*endpoints.Tests
Result:
I also tried a broader existing test file, but it appears blocked by an unrelated existing import problem around
sectorperformance.pynot being present in the branch.