+ Reply to Thread
Results 1 to 17 of 17

API Not Working

  1. #1
    Forum Contributor
    Join Date
    09-09-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    176

    API Not Working

    I have attached a workbook that I need to make the API from the website that is listed in the workbook function properly. I have some VBA but need to make it work properly, then after collecting the data, I want need help programming to be able to do some analysis on the data after it is collected. Any help would greatly be appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: API Not Working

    You have missed the function call to JSON parser: Set Parsed = JsonConverter.parseJSON(Upload)
    You need to include this function in your code.
    The link has got all the functions you need.

    https://www.excelforum.com/excel-pro...using-api.html

  3. #3
    Forum Contributor
    Join Date
    09-09-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    176

    Re: API Not Working

    I did not write that code so I do not know how to do what you are saying. Also, i need to get those buttons working, then figure out how to generate a line chart after data is imported from the API... Any help would be greatly appreciated.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: API Not Working

    Well, I do not know and do not have your API. You need to register with the owner of the site and get an API as the site requires one. Since exposing an API key to a public is not good idea, I suggest you should follow the above link. The OP on that thread did not know anything about API, but managed the code to get to work.

  5. #5
    Forum Contributor
    Join Date
    09-09-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    176

    Re: API Not Working

    https://coinmarketcap.com/api/ is where their API is listed. They are public API's. I just don't know how or where to insert them into the VBA...

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: API Not Working

    Since I have started it, I managed to get the figures you are want, but big IF, this is just a sample from the first link-https://api.coinmarketcap.com/v1/ticker/. The link has many lines of the same data, but the code just picks up from the first line ONLY.
    You need to do a couple of things before you run the code.
    You need to go to VBE editor, Tools and tick the following libraries:
    Microsoft Scripting Runtime Library.
    XML v6.0
    Microsoft WINHTTP Services Library.
    I have added the JSON parser from the above link in to your module.
    I know this might be complicated for you since you are new to VBA, but unfortunately, VBA does not have a native JSON parser, we need to use a third-part code plus some VBA's libraries. You might need to adjust the code for the other links as well.
    That is all I could do for you.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    09-09-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    176

    Re: API Not Working

    I appreciate your help to this point. is there a way to apply the VBA to the "download" Button on the worksheet?

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: API Not Working

    The code is now attached to the "Download" button. Just click it and see the output.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    09-09-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    176

    Re: API Not Working

    Wow!! that is awesome!!! thats what i'm talking about.... Lol So in the cell where I typed "xlm/eth", that is like a search for a specific ticker Symbol.. then the radial button next to it would prompt for the search for whatever symbol gets typed into the search box..... Is that possible too??

  10. #10
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: API Not Working

    Hmm! I am wondering where this thread is going to end
    Just change the symbol in C9 and press the same button and see the result. I have not touched the other button.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    09-09-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    176

    Re: API Not Working

    That doesn't seem to work on my end.... Typed a different symbol in and pressed the download button and nothing happens...??

  12. #12
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: API Not Working

    Well, it has to be the same URL. There are 100 symbols and I have tested all of them.
    Post the symbol and will test it.
    Last edited by AB33; 01-21-2018 at 03:03 PM.

  13. #13
    Forum Contributor
    Join Date
    09-09-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    176

    Re: API Not Working

    Ahhh, just discovered.... It appears to be case sensitive....When I went all CAPS, it worked...I wonder when this thread is going to end.....Lol. In summary, what I am ultimately trying to accomplish is import data into this workbook, then anylise the results via possible line chart, but more importantly, I want to be able to look at the history of a given symbol and find out what it's mean is, then be able to see how often and how much above and below the mean takes place and how much time goes by till large spikes or large drops take place.... I think if I could get the historic data imported, then I could somehow extract that type of data.... but you don't have to keep messing with it if you don't feel like it... Maybe somebody will come along that would get a kick out of it.... I sure appreciate your help and mad skills with VBA.. Awesome work!! I would love to see what you can do with what I just explained but will understand if you decline...Still much appreciate what you have done so far though, Thanks again!!!

  14. #14
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: API Not Working

    I would not promise anything due to time constraints. I need more information and clarification.
    You can use this amended line to enter the symbol in to a small cases.

    If Parsed(i)("symbol") = UCase(Trim(.Range("C9"))) Then

  15. #15
    Forum Contributor
    Join Date
    09-09-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    176

    Re: API Not Working

    HTML Code: 
    . I want to find the middle, or average of the Highest to the Lowest price over a user selected time period or all time as shown in the attached link to the same website. I want to be able to import to Excel and analyze the data.
    Attached Images Attached Images

  16. #16
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: API Not Working

    Sorry! I simply do not know how to get data from a chart. I suggest you start a new thread and hopefully, somebody will butt in.

  17. #17
    Forum Contributor
    Join Date
    09-09-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    176

    Re: API Not Working

    Ok, will do.... Thank you So much for your help, Great job!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 08-30-2017, 02:32 AM
  2. Format a part of a text working with only value not working with formula result
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-10-2017, 05:41 AM
  3. Replies: 1
    Last Post: 02-27-2016, 06:28 PM
  4. Correct/Working (Index,Match) formula not working between cells
    By barnerd in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 02-11-2014, 01:20 PM
  5. Replies: 4
    Last Post: 09-03-2013, 02:52 AM
  6. Replies: 2
    Last Post: 08-17-2012, 08:16 AM
  7. Replies: 1
    Last Post: 01-26-2005, 04:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1