{"id":1925,"date":"2020-04-08T17:53:54","date_gmt":"2020-04-08T17:53:54","guid":{"rendered":"http:\/\/algotrading101.com\/learn\/?p=1925"},"modified":"2021-01-11T16:19:21","modified_gmt":"2021-01-11T16:19:21","slug":"alpha-vantage-guide","status":"publish","type":"post","link":"https:\/\/algotrading101.com\/learn\/alpha-vantage-guide\/","title":{"rendered":"Alpha Vantage Introduction Guide"},"content":{"rendered":"<div class=\"pvc_clear\"><\/div><p id=\"pvc_stats_1925\" class=\"pvc_stats total_only  \" data-element-id=\"1925\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/algotrading101.com\/learn\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p><div class=\"pvc_clear\"><\/div>\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1021\" height=\"500\" src=\"http:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/Alpha-Vantage-Guide.png\" alt=\"Alpha Vantage Homepage Image\" class=\"wp-image-2024\" srcset=\"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/Alpha-Vantage-Guide.png 1021w, https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/Alpha-Vantage-Guide-300x147.png 300w, https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/Alpha-Vantage-Guide-768x376.png 768w\" sizes=\"(max-width: 1021px) 100vw, 1021px\" \/><figcaption>Alpha Vantage&#8217;s Homepage<\/figcaption><\/figure>\n\n\n\n<p>Table of Contents<\/p>\n\n\n\n<ol><li><a href=\"#what-is-the-alpha-vantage-api\">What is the Alpha Vantage API?<\/a><\/li><li><a href=\"#is-the-alpha-vantage-api-free\">Is the Alpha Vantage API free?<\/a><\/li><li><a href=\"#what-data-does-alpha-vantage-offer\">What kind of data does the Alpha Vantage API offer?<\/a><\/li><li><a href=\"#what-are-advantage-of-using-alpha-vantage\">What are the advantages of using the Alpha Vantage API?<\/a><\/li><li><a href=\"#why-shouldnt-i-use-alpha-vantage-api\">Why shouldn\u2019t I use the Alpha Vantage API?<\/a><\/li><li><a href=\"#what-are-alternatives-to-alpha-vantage-api\">What are some alternatives to the Alpha Vantage API?<\/a><\/li><li><a href=\"#how-do-i-start-with-alpha-vantage-api\">How do I get started with the Alpha Vantage API?<\/a><\/li><li><a href=\"#do-i-need-a-library-for-alpha-vantage-api\">Do I need to use a library to access the Alpha Vantage API?<\/a><\/li><li><a href=\"#how-to-configure-alpha-vantage-library\">How do I configure the Alpha Vantage Library?<\/a><\/li><li><a href=\"#how-to-retrieve-stock-data-with-library\">How do I retrieve stock data using the Alpha Vantage library in Python?<\/a><\/li><li><a href=\"#how-to-retrieve-stock-data-without-library\">How can I get retrieve stock data without using the Alpha Vantage library in Python?<\/a><\/li><li><a href=\"#does-alpha-vantage-work-well-with-pandas\">Does the Alpha Vantage API work well with the Pandas Library?<\/a><\/li><li><a href=\"#should-i-use-json-or-csv-for-my-data\">Should I use the CSV or JSON format for my data?<\/a><\/li><li><a href=\"#how-to-technical-indicators-alpha-vantage\">How can I use technical indicators with the Alpha Vantage library?<\/a><\/li><li><a href=\"#final-thoughts-alpha-vantage-api\">Final Thoughts on the Alpha Vantage API<\/a><\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-the-alpha-vantage-api\">What is the Alpha Vantage API?<\/h2>\n\n\n\n<p>The <a href=\"https:\/\/www.alphavantage.co\/\" target=\"_blank\" rel=\"noreferrer noopener\">Alpha Vantage API<\/a> is a method to obtain historical and realtime data for several markets.<\/p>\n\n\n\n<p>You can access the data directly in Python or any other programming language of your choosing. From there, you can manipulate the data or store it for later use.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"is-the-alpha-vantage-api-free\">Is the Alpha Vantage API free?<\/h2>\n\n\n\n<p>Alpha Vantage proudly offers its service for free. They provide a generous rate limit of 5 requests per minute and 500 requests per day.<\/p>\n\n\n\n<p>Several premium plans are available if you require a higher rate limit. The premium plans start at $29.99 per month for 30 requests per minute and go as high as $249.99 per month for 1200 requests per minute.<\/p>\n\n\n\n<p>Premium plans come with 24\/7 technical support and don&#8217;t have daily limits.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-data-does-alpha-vantage-offer\">What kind of data does the Alpha Vantage API offer?<\/h2>\n\n\n\n<p>Alpha Vantage offers historical and realtime data for stocks, forex, and cryptocurrencies. Several time frames are available ranging from 1-minute bars up to monthly.<\/p>\n\n\n\n<p>In addition to price data, there are more than 50 technical indicators available as well as performance data for 10 US equity sectors.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-are-advantage-of-using-alpha-vantage\">What are the advantages of using the Alpha Vantage API?<\/h2>\n\n\n\n<p>The biggest advantage is that its free. Further, the data is extensive. We found price data dating back 20 years for stocks and forex. Cryptocurrency data for assets like Bitcoin went back as far as 2011 in terms of daily price data.<\/p>\n\n\n\n<div style=\"padding:15px 15px 15px 15px;color: #555555;background-color: #E1FFC1;border: #dddddd 2px solid\">\n<p>\u00bb Quandl Guide: Learn how to retrieve price and non-price data from Quandl. \n<br><br>Examples \n<ol>\n<li>WTI Crude Oil prices<\/li>\n<li>US GDP Data<\/li>\n<li>Facebook Annual Report Data<\/li>\n<\/ol>\n<br>\n<strong>Link: <a href=\"https:\/\/algotrading101.com\/learn\/quandl-guide\/\" rel=\"noopener noreferrer\">Quandl: A Step-by-Step Guide<\/a><\/strong>\n<\/p>\n<\/div>\n<br>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"why-shouldnt-i-use-alpha-vantage-api\">Why shouldn\u2019t I use the Alpha Vantage API?<\/h2>\n\n\n\n<p>You may not want to use the Alpha Vantage API if you already have access to price data through your broker. Data can differ from one provider to another and its best to use broker data if you plan to execute trades.<\/p>\n\n\n\n<p>Along the same lines, some automated systems are very sensitive to small differences in data between different providers. In this scenario, it&#8217;s worthwhile comparing data with other providers. Paid data providers often boast that they have the most accurate data available.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-are-alternatives-to-alpha-vantage-api\">What are some alternatives to the Alpha Vantage API?<\/h2>\n\n\n\n<p>There were a number of free data APIs a few years ago such as Google Finance and Yahoo Finance. Unfortunately, they no longer offer an official API.<\/p>\n\n\n\n<p>The Investors Exchange (IEX) is one of the few providers that still offers free API access. Their offering is a bit more extensive compared to Alpha Vantage. However, their rate limits can be a little tricky as each endpoint carries a different weight in terms of how many requests you can make.<\/p>\n\n\n\n<p style=\"padding:15px 15px 15px 15px;color: #555555;background-color: #E1FFC1;border: #dddddd 2px solid\">\u00bb IEX offers earnings data, news, financial statements in addition to historical data. Check out our IEX API guide: <a href=\"https:\/\/algotrading101.com\/learn\/iex-api\/\" target=\"_blank\" rel=\"noopener noreferrer\">IEX API Introduction Guide<\/a><\/p>\n\n\n\n<p>Another alternative is worldtradingdata.com who offers free access to their trading API for up to 250 requests per day. Premium plans are available starting at $8 per month and go as high as $32 per month.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-do-i-start-with-alpha-vantage-api\">How do I get started with the Alpha Vantage API?<\/h2>\n\n\n\n<p>The first step is to&nbsp;<a target=\"_blank\" href=\"https:\/\/www.alphavantage.co\/support\/#api-key\" rel=\"noreferrer noopener\">claim your API key<\/a>. The process is quick and easy and a key is necessary for all the requests.<\/p>\n\n\n\n<p>After getting your key, we highly recommend having a look at the&nbsp;<a target=\"_blank\" href=\"https:\/\/www.alphavantage.co\/documentation\/\" rel=\"noreferrer noopener\">API documentation<\/a>. You can see what kind of data is being offered, but more importantly, this is where you can figure out which parameters are required for each API request. You will likely be referring to it a lot.<\/p>\n\n\n\n<p>The next step is deciding if you want to utilize the Alpha Vantage library.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"do-i-need-a-library-for-alpha-vantage-api\">Do I need to use a library to access the Alpha Vantage API?<\/h2>\n\n\n\n<p>This is certainly a case where you can get away without using the library, although it does make things a bit easier.<\/p>\n\n\n\n<p>Aside from standard API functionality, the library offers panda&#8217;s integration and simplifies the process of plotting charts.<\/p>\n\n\n\n<p>You can install the library by running <code>pip install alpha_vantage<\/code> from the command prompt. If you don&#8217;t have pandas installed on your system, you can use <code>pip install alpha_vantage pandas<\/code>.<\/p>\n\n\n\n<p>Alternatively, download the zip file from the&nbsp;<a target=\"_blank\" href=\"https:\/\/github.com\/RomelTorres\/alpha_vantage\" rel=\"noreferrer noopener\">GitHub repository<\/a>&nbsp;and extract the <code>alpha_vantage<\/code> folder in your projects folder.<\/p>\n\n\n\n<p>If you&#8217;ve gone through our Alpaca API guide &lt;INSERT LINK&gt; you will already have the Alpha Vantage python library on your system.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-configure-alpha-vantage-library\">How do I configure the Alpha Vantage Library?<\/h2>\n\n\n\n<p>After installing the Alpha Vantage library, it is a good idea to store your API key as an environment variable. This is an extra security precaution so that your key is not visible in plain text within your code.<\/p>\n\n\n\n<p>There have been instances where individuals have pushed code to their public GitHub page only to have someone exploit their key, so this step is highly recommended.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Saving your key as an environment variable<\/h3>\n\n\n\n<p><strong>Windows <\/strong>&#8211; Click Start and type in <em>environment variables<\/em>. You should see an option to <em>Edit environment variables for your account<\/em>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"785\" height=\"560\" src=\"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/env_variable_win.jpg\" alt=\"\" class=\"wp-image-1862\" srcset=\"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/env_variable_win.jpg 785w, https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/env_variable_win-300x214.jpg 300w, https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/env_variable_win-768x548.jpg 768w\" sizes=\"(max-width: 785px) 100vw, 785px\" \/><figcaption>Setting an environment variable in Windows<\/figcaption><\/figure>\n\n\n\n<p>In the new window that pops up, click <em>New <\/em>under the <em>User variables<\/em> section.<\/p>\n\n\n\n<p>Your variable name should be <code>ALPHAVANTAGE_API_KEY<\/code> and the variable value is where you can paste in your key.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"652\" height=\"165\" src=\"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/new_user_variable.jpg\" alt=\"\" class=\"wp-image-1881\" srcset=\"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/new_user_variable.jpg 652w, https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/new_user_variable-300x76.jpg 300w\" sizes=\"(max-width: 652px) 100vw, 652px\" \/><figcaption>Creating a New User Variable in Windows<\/figcaption><\/figure>\n\n\n\n<p><strong>Mac\/Linux<\/strong> &#8211; From your terminal, type in:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">export ALPHAVANTAGE_API_KEY=123456789<\/pre>\n\n\n\n<p>Make sure to use your actual API key for the value. You can confirm that the environment variable is saved by typing in the following which should display your API key:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">echo $ALPHAVANTAGE_API_KEY<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"678\" height=\"366\" src=\"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/env_variable_mac_linux.jpg\" alt=\"\" class=\"wp-image-1863\" srcset=\"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/env_variable_mac_linux.jpg 678w, https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/env_variable_mac_linux-300x162.jpg 300w\" sizes=\"(max-width: 678px) 100vw, 678px\" \/><figcaption>Creating an environment variable in Linux<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"337\" src=\"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/env_variable_mac-1024x337.jpg\" alt=\"\" class=\"wp-image-1878\" srcset=\"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/env_variable_mac-1024x337.jpg 1024w, https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/env_variable_mac-300x99.jpg 300w, https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/env_variable_mac-768x253.jpg 768w, https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/env_variable_mac.jpg 1140w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption> Creating an environment variable on a Mac<\/figcaption><\/figure>\n\n\n\n<p>If the environment variable comes up blank in Python you made need to restart your code editor for the changes to take effect.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Importing the library into Python<\/h3>\n\n\n\n<p>After setting the environment variable, you&#8217;ll want to import the Alpha Vantage library into Python.<\/p>\n\n\n\n<p>The library is set up in such a way that each of the 5 sections within the Alpha Vantage API documentation has been coded in a separate file within the library.<\/p>\n\n\n\n<p>You will have to import the appropriate part of the library and instantiate the class within it. Here is an example.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from alpha_vantage.timeseries import TimeSeries\n\napp = TimeSeries() <\/pre>\n\n\n\n<p>In the above code, we import the TimeSeries class from timeseries.py which is the part of the library that handles API calls for stock data. We then instantiate the TimeSeries class to inherit all of its functions.<\/p>\n\n\n\n<p>If you didn&#8217;t store your API key in an environment variable, you can pass it through when instantiating the class like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">app = TimeSeries('your_api_key_goes_here')<\/pre>\n\n\n\n<p>Otherwise, the library will automatically grab the API key from the environment variable for you.<\/p>\n\n\n\n<p>To make things easier, we&#8217;ve created a table that links the required import statement corresponding to each section of the Alpha Vantage documentation.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Alpha Vantage<\/th><th>Import statement for library<\/th><\/tr><tr><td>Stock Time Series<\/td><td> from alpha_vantage.timeseries import TimeSeries<\/td><\/tr><tr><td>Forex (FX)<\/td><td> from alpha_vantage.foreignexchange import ForeignExchange <\/td><\/tr><tr><td>Cryptocurrencies<\/td><td>from alpha_vantage.cryptocurrencies import CryptoCurrencies<\/td><\/tr><tr><td>Technical Indicators<\/td><td>from alpha_vantage.techindicators import TechIndicators<\/td><\/tr><tr><td>Sector Performances<\/td><td>from alpha_vantage.sectorperformance import SectorPerformances<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-retrieve-stock-data-with-library\">How do I retrieve stock data using the Alpha Vantage library in Python?<\/h2>\n\n\n\n<p>At this point, we&#8217;ve imported the library and instantiated the TimeSeries class. Our next step is to grab some data.<\/p>\n\n\n\n<p>There are several options available under the Stock Time Series section of the Alpha Vantage documentation. We will go with Daily Adjusted data, otherwise known as TIME_SERIES_DAILY_ADJUSTED.<\/p>\n\n\n\n<p>We need to figure out which function in the library corresponds with the API endpoint we are trying to call. We can do that by running the help command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">help(app)<\/pre>\n\n\n\n<p>This gives us a printout of all the different functions available within the TimeSeries class. They are in the same order as they appear in the documentation so it should be easy to find the right one.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"911\" height=\"293\" src=\"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/get_daily_adjusted.jpg\" alt=\"\" class=\"wp-image-1869\" srcset=\"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/get_daily_adjusted.jpg 911w, https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/get_daily_adjusted-300x96.jpg 300w, https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/get_daily_adjusted-768x247.jpg 768w\" sizes=\"(max-width: 911px) 100vw, 911px\" \/><\/figure>\n\n\n\n<p>The image above shows the function we are after. As you can see, the only parameter we need to pass through is the stock ticker symbol.<\/p>\n\n\n\n<p>By default, the library will set the output size to compact. This will return the last 100 data points. If you are looking to for more data then simply pass through <code>output='full'<\/code> to get all the data available.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from alpha_vantage.timeseries import TimeSeries\n\napp = TimeSeries()\n#help(app)\n\naapl = app.get_daily_adjusted('AAPL', outputsize='full')\nprint(appl)<\/pre>\n\n\n\n<p>And there you have it, the last 100 daily data points for AAPL in four lines of code.<\/p>\n\n\n\n<p>The return output by default is in JSON. Further in the tutorial, we will discuss outputting data in CSV and in pandas.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-retrieve-stock-data-without-library\">How can I get retrieve stock data without using the Alpha Vantage library in Python?<\/h2>\n\n\n\n<p>We can get the same data in the above example without using the Alpha Vantage library fairly easily. There are numerous libraries available to access URLs. Commonly known libraries include http.client, requests, and urllib just to name a few.<\/p>\n\n\n\n<p>In our example, we will use the requests library. If you don&#8217;t already have it installed, type in <code>pip install requests<\/code> to install it.<\/p>\n\n\n\n<p>Our first step is to import the requests library and the os library. The latter will be used to retrieve our API key from the environment variable that we created.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import requests\nimport os\n\napi_key = os.getenv('ALPHAVANTAGE_API_KEY')\nprint(api_key)<\/pre>\n\n\n\n<p>The above code will print out your API key, just to make sure everything is working. If you don&#8217;t have your key saved as an environment variable, you can assign your key to the <code>api_key<\/code> variable at this point.<\/p>\n\n\n\n<p>You may have noticed that the Alpha Vantage documentation has examples in each section. Let&#8217;s copy the first example URL in the documentation for TIME_SERIES_DAILY_ADJUSTED and create a request.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">response = requests.get('https:\/\/www.alphavantage.co\/query?function=TIME_SERIES_DAILY_ADJUSTED&amp;symbol=IBM&amp;apikey=demo')\nprint(response.json())<\/pre>\n\n\n\n<p>In the above code, we&#8217;ve passed in the entire URL right into the request. At that point, we used .json(), which is part of the requests library, to convert the JSON data to a Python dictionary.<\/p>\n\n\n\n<p>As you can see, we can make requests by simply passing through our parameters into the URL.<\/p>\n\n\n\n<p>We can even use an <a href=\"https:\/\/www.python.org\/dev\/peps\/pep-0498\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"f string (opens in a new tab)\">f string<\/a> to make the parameters a bit more dynamic.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">base_url = 'https:\/\/www.alphavantage.co\/query?'\nfunction = 'TIME_SERIES_DAILY_ADJUSTED'\nsymbol = 'IBM'\n\nresponse = requests.get(f'{base_url}function={function}&amp;symbol={symbol}&amp;apikey={api_key}')\nprint(response.json())<\/pre>\n\n\n\n<p>The above code allows us to easily change the parameters by assigning different values for the associated variables.<\/p>\n\n\n\n<p>Passing through the entire URL with parameters, or using f strings, will give you the desired result. However, it&#8217;s not a very Pythonic way of doing things. The code snippet below attempts to &#8216;clean things up a bit&#8217;.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">base_url = 'https:\/\/www.alphavantage.co\/query?'\nparams = {'function': 'TIME_SERIES_DAILY_ADJUSTED',\n\t\t 'symbol': 'IBM',\n\t\t 'apikey': api_key}\n\nresponse = requests.get(base_url, params=params)\nprint(response.json())<\/pre>\n\n\n\n<p>What we&#8217;ve done here is created a dictionary that holds all of our parameters. We then pass the dictionary into our request which is a much cleaner way of doing this. Especially for calls where several parameters are required. It also makes our code much more readable in case we have to make changes down the road.<\/p>\n\n\n\n<p>Now that we have our base code for making requests, you should be able to query any of the Alpha Vantage endpoints. Simply modify or append the params dictionary with the required API parameters listed within the documentation. The base URL will remain the same for all queries.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"does-alpha-vantage-work-well-with-pandas\">Does the Alpha Vantage API work well with the pandas library?<\/h2>\n\n\n\n<p>The pandas library is great for manipulating data and is popular among algo traders.<\/p>\n\n\n\n<p>Integration with pandas is built into the Alpha Vantage library. Simply pass through <code>output_format='pandas'<\/code> when instantiating the appropriate class for your request.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from alpha_vantage.foreignexchange import ForeignExchange\n\napp = ForeignExchange(output_format='pandas')\n\neurusd = app.get_currency_exchange_intraday('EUR', 'USD')\nprint(eurusd[0])<\/pre>\n\n\n\n<p>In the above example, we are requesting intraday data for EUR\/USD. By default, the library returns 15 minute candles for this particular endpoint.<\/p>\n\n\n\n<p>The returned data is a tuple that contains the pandas dataframe as well as information about the returned data. Since we&#8217;re only interested in the dataframe, we&#8217;ve specified print(eurusd[0]) to separate the dataframe from the tuple.<\/p>\n\n\n\n<p>What&#8217;s great about the dataframe returned by the library is that it is formated with a time-series index. That means we can run commands like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">print(eurusd[0]['2020-04-01'])<\/pre>\n\n\n\n<p>This allows us to narrow down our dataframe to only candles from April 1st.<\/p>\n\n\n\n<p>Below is the code to perform the same function without using the library.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import os\nimport requests\nimport pandas as pd \n\napi_key = os.getenv('ALPHAVANTAGE_API_KEY')\n\nbase_url = 'https:\/\/www.alphavantage.co\/query?'\nparams = {'function': 'FX_INTRADAY',\n  'from_symbol': 'EUR',\n  'to_symbol': 'USD', \n  'interval': '15min',\n  'apikey': api_key}\n\nresponse = requests.get(base_url, params=params)\nresponse_dict = response.json()\n_, header = response.json()\n\n#Convert to pandas dataframe\ndf = pd.DataFrame.from_dict(response_dict[header], orient='index')\n\n#Clean up column names\ndf_cols = [i.split(' ')[1] for i in df.columns]\ndf.columns = df_cols\n\ndf.set_index('timestamp', inplace=True) #Time-series index \n\nprint(df)<\/pre>\n\n\n\n<p>Getting the response into a dataframe isn&#8217;t straightforward but can be done with a few tweaks.<\/p>\n\n\n\n<p>First, we had to separate out our price data from the JSON response as it contains two parts of information. The first part provides information about the query, or essentially, metadata. The second part is the price data that we are after. So we&#8217;ve had to specify that we only want to convert the time series data into a dataframe.<\/p>\n\n\n\n<p>We were able to separate the two parts of the response with this command: <code>_, header = response.json()<\/code>. This is a dynamic method to obtain the dictionary key value for the price data. We then use that information to convert our dictionary to a pandas dataframe.<\/p>\n\n\n\n<p>We also had to add <code>orient='index'<\/code>. Otherwise, the row and columns are inversed due to the nature of the response format.<\/p>\n\n\n\n<p>Lastly, we&#8217;ve cleaned up the column headers just to remove any numbers or spaces and set the timestamp column as the index to create a time-series index.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"should-i-use-json-or-csv-for-my-data\">Should I use the CSV or JSON format for my data?<\/h2>\n\n\n\n<p>Choosing between CSV or JSON comes down to what you intend on doing with the data after the fact, and to a certain degree, personal preference.<\/p>\n\n\n\n<p>The advantage of the CSV format is that it comes with little overhead. Unlike the JSON format, it does not accompany metadata. Further, the column headers are already neatly formatted.<\/p>\n\n\n\n<p>The disadvantage of the CSV format is that it is not easily recognized by Python. You may have noticed how easily the requests module is able to convert JSON objects to a dictionary in the previous examples.<\/p>\n\n\n\n<p>You can use the CSV module which is a standard Python library, although we find that method to be tedious &#8211; again personal preference.<\/p>\n\n\n\n<p>If you&#8217;re looking to save data for later use, CSV is the way to go. Check out the code snippet below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import os\nimport requests\nimport pandas as pd\n\napi_key = os.getenv('ALPHAVANTAGE_API_KEY')\n\nbase_url = 'https:\/\/www.alphavantage.co\/query?'\nparams = {'function': 'FX_INTRADAY',\n\t\t 'from_symbol': 'EUR',\n\t\t 'to_symbol': 'USD', \n\t\t 'interval': '15min',\n\t\t 'datatype': 'csv',\n\t\t 'apikey': api_key}\n\nresponse = requests.get(base_url, params=params)\n\n#Save CSV to file\nwith open('eurusd.csv', 'wb') as file:\n\tfile.write(response.content)\n\ndf = pd.read_csv('eurusd.csv') #Create pandas dataframe\n\ndf.set_index('timestamp', inplace=True) #Time-series index<\/pre>\n\n\n\n<p>Notice that we&#8217;re able to get save the response as a file in two lines of codes. Further, once saved, we can retrieve the data directly into a pandas dataframe using only one line of code.<\/p>\n\n\n\n<p>If you attempt to save the CSV response directly to a dataframe, you&#8217;re likely to get an error unless you clean up the data first. <\/p>\n\n\n\n<p>If you plan to use the Alpha Vantage library, your best bet is to use the pandas output format. If you need to save your pandas dataframe to file, simply use the following syntax:<\/p>\n\n\n\n<p>df.to_csv(&#8216;filename.csv&#8217;)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-technical-indicators-alpha-vantage\">How can I use technical indicators with the Alpha Vantage library?<\/h2>\n\n\n\n<p>A great feature of the Alpha Vantage API is that it has values for over 50 different indicators. This saves having to manually calculate them or use a third-party library.<\/p>\n\n\n\n<p>Let&#8217;s look at an example of getting MACD data for AAPL.<\/p>\n\n\n\n<p>The Alpha Vantage library uses a standard naming convention in the TechIndicators class. Simply use <code>get_<\/code> and add the name of the indicator as it is stated in the documentation<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">help(app.get_macd)<\/pre>\n\n\n\n<p>Similar to one of the prior examples, we can use the help function to find out the required arguments<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"952\" height=\"415\" src=\"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/MACD_help.jpg\" alt=\"\" class=\"wp-image-1871\" srcset=\"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/MACD_help.jpg 952w, https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/MACD_help-300x131.jpg 300w, https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/MACD_help-768x335.jpg 768w\" sizes=\"(max-width: 952px) 100vw, 952px\" \/><\/figure>\n\n\n\n<p>We can see that we need to supply at least a symbol, the fast period, slow period, and signal period. The indicator will be calculated on the closing price by default which is what we want. The interval is set to daily by default.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from alpha_vantage.techindicators import TechIndicators\n\napp = TechIndicators(output_format='pandas')\n#help(app.get_macd)\n\naapl_macd = app.get_macd('aapl', fastperiod=12, slowperiod=26, signalperiod=9)\nprint(aapl_macd)<\/pre>\n\n\n\n<p>In the code example above, we started by importing the TechIndicators class. We then instantiated our class, specifying that the output should be a pandas data frame. The required parameters were passed through the function and the output was saved as <code>aapl_macd<\/code>.<\/p>\n\n\n\n<p>You can use the same format used in the code snippet above to get values for other indicators. A cool feature of time-series dataframes is that we can easily merge our indicator dataframe with a price dataframe. Pandas will match up merged dataframes with the index column which in our case is a timestamp.<\/p>\n\n\n\n<p>You may have noticed when we pulled Forex data that we had to separately specify the from currency and to currency. For technical indicators, the syntax differs in that the symbol is used as a whole. Take a look at the following examples for Bitcoin and USD\/JPY.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">BTC_macd = app.get_macd('BTCUSD', fastperiod=12, slowperiod=26, signalperiod=9)<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">usdjpy_macd = app.get_macd('USDJPY', fastperiod=12, slowperiod=26, signalperiod=9)<\/pre>\n\n\n\n<p>While this is a useful feature of the API, we recommend only using it for historical data. If you attempt to use it for realtime data, especially on smaller time frames, make sure not to go over your rate limit.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"final-thoughts-alpha-vantage-api\">Final Thoughts<\/h2>\n\n\n\n<p>Alpha Vantage offers a great product, and best of all, the free API has a very generous rate limit. The Alpha Vantage library makes the API easier to use, especially if you plan to use pandas.<\/p>\n\n\n\n<p>If you intend to use the API as part of your automated trading system we suggest you implement some form of error checking to confirm that your request did in fact return valid data as internet interruptions do happen. Also, be mindful of the 500 requests per day limit and make sure your API key is kept secure.<\/p>\n\n\n\n<p><strong>Download Code<\/strong><\/p>\n\n\n\n<p>The code used in the examples is <a rel=\"noreferrer noopener\" aria-label=\"available on GitHub (opens in a new tab)\" href=\"https:\/\/github.com\/PythonForForex\/Alpha-Vantage-Introduction-Guide\" target=\"_blank\">available on GitHub<\/a>. From the GitHub page, click the green button on the right \u201cClone or download\u201d to download or clone the code.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_1925\" class=\"pvc_stats total_only  \" data-element-id=\"1925\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/algotrading101.com\/learn\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p>Table of Contents What is the Alpha Vantage API? Is the Alpha Vantage API free? What kind of data does the Alpha Vantage API offer? What are the advantages of using the Alpha Vantage API? Why shouldn\u2019t I use the Alpha Vantage API? What are some alternatives to the Alpha Vantage API? How do I [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":2024,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"no","_lmt_disable":"no","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[3,2],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Alpha Vantage Introduction Guide - AlgoTrading101 Blog<\/title>\n<meta name=\"description\" content=\"Alpha Vantage offers historical and realtime data for stocks, forex, and cryptocurrencies for free. They provide a rate limit of 500 requests per day.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/algotrading101.com\/learn\/alpha-vantage-guide\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Alpha Vantage Introduction Guide - AlgoTrading101 Blog\" \/>\n<meta property=\"og:description\" content=\"Alpha Vantage offers historical and realtime data for stocks, forex, and cryptocurrencies for free. They provide a rate limit of 500 requests per day.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/algotrading101.com\/learn\/alpha-vantage-guide\/\" \/>\n<meta property=\"og:site_name\" content=\"Quantitative Trading Ideas and Guides - AlgoTrading101 Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-08T17:53:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-01-11T16:19:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/Alpha-Vantage-Guide.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1021\" \/>\n\t<meta property=\"og:image:height\" content=\"500\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Jignesh Davda\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jignesh Davda\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"17 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Alpha Vantage Introduction Guide - AlgoTrading101 Blog","description":"Alpha Vantage offers historical and realtime data for stocks, forex, and cryptocurrencies for free. They provide a rate limit of 500 requests per day.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/algotrading101.com\/learn\/alpha-vantage-guide\/","og_locale":"en_US","og_type":"article","og_title":"Alpha Vantage Introduction Guide - AlgoTrading101 Blog","og_description":"Alpha Vantage offers historical and realtime data for stocks, forex, and cryptocurrencies for free. They provide a rate limit of 500 requests per day.","og_url":"https:\/\/algotrading101.com\/learn\/alpha-vantage-guide\/","og_site_name":"Quantitative Trading Ideas and Guides - AlgoTrading101 Blog","article_published_time":"2020-04-08T17:53:54+00:00","article_modified_time":"2021-01-11T16:19:21+00:00","og_image":[{"width":1021,"height":500,"url":"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/04\/Alpha-Vantage-Guide.png","type":"image\/png"}],"author":"Jignesh Davda","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jignesh Davda","Est. reading time":"17 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/algotrading101.com\/learn\/alpha-vantage-guide\/#article","isPartOf":{"@id":"https:\/\/algotrading101.com\/learn\/alpha-vantage-guide\/"},"author":{"name":"Jignesh Davda","@id":"https:\/\/algotrading101.com\/learn\/#\/schema\/person\/f8764d9c5a5b73e3d5e235f601774b79"},"headline":"Alpha Vantage Introduction Guide","datePublished":"2020-04-08T17:53:54+00:00","dateModified":"2021-01-11T16:19:21+00:00","mainEntityOfPage":{"@id":"https:\/\/algotrading101.com\/learn\/alpha-vantage-guide\/"},"wordCount":2969,"publisher":{"@id":"https:\/\/algotrading101.com\/learn\/#organization"},"articleSection":["Programming","Trading"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/algotrading101.com\/learn\/alpha-vantage-guide\/","url":"https:\/\/algotrading101.com\/learn\/alpha-vantage-guide\/","name":"Alpha Vantage Introduction Guide - AlgoTrading101 Blog","isPartOf":{"@id":"https:\/\/algotrading101.com\/learn\/#website"},"datePublished":"2020-04-08T17:53:54+00:00","dateModified":"2021-01-11T16:19:21+00:00","description":"Alpha Vantage offers historical and realtime data for stocks, forex, and cryptocurrencies for free. They provide a rate limit of 500 requests per day.","breadcrumb":{"@id":"https:\/\/algotrading101.com\/learn\/alpha-vantage-guide\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/algotrading101.com\/learn\/alpha-vantage-guide\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/algotrading101.com\/learn\/alpha-vantage-guide\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/algotrading101.com\/learn\/"},{"@type":"ListItem","position":2,"name":"Alpha Vantage Introduction Guide"}]},{"@type":"WebSite","@id":"https:\/\/algotrading101.com\/learn\/#website","url":"https:\/\/algotrading101.com\/learn\/","name":"Quantitative Trading Ideas and Guides - AlgoTrading101 Blog","description":"Authentic Stories about Algorithmic trading, coding and life.","publisher":{"@id":"https:\/\/algotrading101.com\/learn\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/algotrading101.com\/learn\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/algotrading101.com\/learn\/#organization","name":"AlgoTrading101","url":"https:\/\/algotrading101.com\/learn\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/algotrading101.com\/learn\/#\/schema\/logo\/image\/","url":"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/11\/AlgoTrading101-Lucas-Liew.jpg","contentUrl":"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/11\/AlgoTrading101-Lucas-Liew.jpg","width":1200,"height":627,"caption":"AlgoTrading101"},"image":{"@id":"https:\/\/algotrading101.com\/learn\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/algotrading101.com\/learn\/#\/schema\/person\/f8764d9c5a5b73e3d5e235f601774b79","name":"Jignesh Davda","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/algotrading101.com\/learn\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/44f66584169f5f2d9c0b7ffead97a9c9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/44f66584169f5f2d9c0b7ffead97a9c9?s=96&d=mm&r=g","caption":"Jignesh Davda"},"sameAs":["https:\/\/www.thegoldanalyst.com","https:\/\/www.linkedin.com\/in\/jignesh-davda-880bb02\/"],"url":"https:\/\/algotrading101.com\/learn\/author\/jdavda\/"}]}},"modified_by":"Lucas Liew","_links":{"self":[{"href":"https:\/\/algotrading101.com\/learn\/wp-json\/wp\/v2\/posts\/1925"}],"collection":[{"href":"https:\/\/algotrading101.com\/learn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/algotrading101.com\/learn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/algotrading101.com\/learn\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/algotrading101.com\/learn\/wp-json\/wp\/v2\/comments?post=1925"}],"version-history":[{"count":20,"href":"https:\/\/algotrading101.com\/learn\/wp-json\/wp\/v2\/posts\/1925\/revisions"}],"predecessor-version":[{"id":7251,"href":"https:\/\/algotrading101.com\/learn\/wp-json\/wp\/v2\/posts\/1925\/revisions\/7251"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/algotrading101.com\/learn\/wp-json\/wp\/v2\/media\/2024"}],"wp:attachment":[{"href":"https:\/\/algotrading101.com\/learn\/wp-json\/wp\/v2\/media?parent=1925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/algotrading101.com\/learn\/wp-json\/wp\/v2\/categories?post=1925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/algotrading101.com\/learn\/wp-json\/wp\/v2\/tags?post=1925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}