Forum Home
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular

    [DEV] APIv2 - Feathercoin Application programming interface v2

    Technical Development
    8
    17
    5812
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Bushstar
      Bushstar last edited by

      Excellent. Please check back in here to keep tabs on development. I hope to have the new API us by the end of this week. It will be largely there may be some changes that you need to know.

      For example currencies will be returned as JSON unless it is toggled off with &json=0

      You can get the difficulty from the explorer.

      [url=http://explorer.feathercoin.com/chain/Feathercoin/q/getdifficulty]http://explorer.feathercoin.com/chain/Feathercoin/q/getdifficulty[/url]

      Full explorer API can be viewed below.

      [url=http://explorer.feathercoin.com/q]http://explorer.feathercoin.com/q[/url]

      I will replicate some of the explorer API to save people switching between places. I have moved the API and explorer on to the same box to create our stats server.

      Please let me know if you have any additional requirements for the API.

      Donate: 6hf9DF8H67ZEoW9KmPJez6BHh4XPNQSCZz

      1 Reply Last reply Reply Quote 0
      • U
        UKMark last edited by

        [quote name=“BatesResearch” post=“31194” timestamp=“1381762624”]
        Hi,

        We am currently using the API in our Feathercoin website, it’s very helpful. One question can we pull the current difficulty of feathercoin from the API? We’ve seen [url=http://api.feathercoin.com/?output=stats]http://api.feathercoin.com/?output=stats[/url] but just need the nowdiff
        [/quote]

        To parse the value of the key “nowdiff” I would suggest using .php [url=http://php.net/manual/en/function.json-decode.php]json_decode()[/url]…So a quick example…sanitation is your responsibility :)

        [code]$datain = @file_get_contents(“http://api.feathercoin.com/?output=stats”);
        if ($datain === True)
        {
        $dataout = json_decode($datain, true);
        $vardiff = $dataout[‘nowdiff’];
        //$vardiff is now the value of key ‘nowdiff’
        echo $vardiff;
        // Do whatever else you want to do here…
        }
        [/code]

        1 Reply Last reply Reply Quote 0
        • Bushstar
          Bushstar last edited by

          New API is live though I need to format the front of it into a more readable table :)

          https://api.feathercoin.com/

          The calls all return JSON though some of them can be changed to plaintext result with &json=0

          Donate: 6hf9DF8H67ZEoW9KmPJez6BHh4XPNQSCZz

          1 Reply Last reply Reply Quote 0
          • kris_davison
            kris_davison last edited by

            Looks great you have added some really usefull stuff here. This could make it much more simple to check for payment transaction confirms.
            Can I ask what data you are using to work out the exchange rates?

            Alse the address balance part after how many confirms On a new transaction is the balance considered to be updated? Kris

            1 Reply Last reply Reply Quote 0
            • Bushstar
              Bushstar last edited by

              [quote name=“kris_davison” post=“31497” timestamp=“1382012032”]
              Looks great you have added some really usefull stuff here. This could make it much more simple to check for payment transaction confirms.
              Can I ask what data you are using to work out the exchange rates?

              Alse the address balance part after how many confirms On a new transaction is the balance considered to be updated? Kris
              [/quote]

              Fiat currency values are pulled from the following location.
              [url=http://currency-api.appspot.com/]http://currency-api.appspot.com/[/url]
              Value of Bitcoin and Feathercoin are pulled from BTC-e

              The balance shown for an address is the total in - total out. The balance shows as soon as the transaction has been accepted into the blockchain.

              You can check the confirms of the transactions in with the getconflasttx option. In the old API this was being parsed from the explorer HTML. In the new API I actually extended the explorer’s API to include a call of the same name but get the data from the database.

              Note that the explorer is currently being rebuilt so it looks as if it is in the past at the moment.

              Donate: 6hf9DF8H67ZEoW9KmPJez6BHh4XPNQSCZz

              1 Reply Last reply Reply Quote 0
              • kris_davison
                kris_davison last edited by

                That’s great help thanks very much :-)

                1 Reply Last reply Reply Quote 0
                • kris_davison
                  kris_davison last edited by

                  I may be missing something here but I tried the example.
                  https://api.feathercoin.com/?output=balance&address=6pde7co3E5neUGDmtZctpATZ2u1ydgnoHf&json=1

                  Which results in 0.1

                  I then tried this example for the same address
                  Well its a cobbled together example as the one on API page seems incomplete.

                  https://api.feathercoin.com?output=getconflasttx&address= 6pde7co3E5neUGDmtZctpATZ2u1ydgnoHf

                  This results in 0 confirms.

                  Is this correct?

                  1 Reply Last reply Reply Quote 0
                  • M
                    mnstrcck last edited by

                    [quote name=“kris_davison” post=“31531” timestamp=“1382027128”]
                    Is this correct?
                    [/quote]

                    Fixed it for you, you missed a / & added an extra space it looks like.

                    https://api.feathercoin.com/?output=getconflasttx&address=6pde7co3E5neUGDmtZctpATZ2u1ydgnoHf

                    1 Reply Last reply Reply Quote 0
                    • kris_davison
                      kris_davison last edited by

                      Ah that’s better cheers.

                      1 Reply Last reply Reply Quote 0
                      • Bushstar
                        Bushstar last edited by

                        For the market I have added another feature to the API which probably should have been their already. Fiat to Feathercoin as well as Feathercoin to fiat. It is not hard to to find one from the other but to save people the trouble the API will serve either or to make life easier :)

                        This shows the value of all supported currencies in Feathercoin
                        [url=http://api.feathercoin.com/?output=ftccurrencies&amount=1]http://api.feathercoin.com/?output=ftccurrencies&amount=1[/url]

                        This shows the value of each currency in Feathercoin separately.
                        [url=http://api.feathercoin.com/?output=ftcaud&amount=1&json=1]http://api.feathercoin.com/?output=ftcaud&amount=1&json=1[/url]
                        [url=http://api.feathercoin.com/?output=ftceur&amount=1&json=1]http://api.feathercoin.com/?output=ftceur&amount=1&json=1[/url]
                        [url=http://api.feathercoin.com/?output=ftcgbp&amount=1&json=1]http://api.feathercoin.com/?output=ftcgbp&amount=1&json=1[/url]
                        [url=http://api.feathercoin.com/?output=ftcnzb&amount=1&json=1]http://api.feathercoin.com/?output=ftcnzb&amount=1&json=1[/url]
                        [url=http://api.feathercoin.com/?output=ftcusd&amount=1&json=1]http://api.feathercoin.com/?output=ftcusd&amount=1&json=1[/url]

                        Donate: 6hf9DF8H67ZEoW9KmPJez6BHh4XPNQSCZz

                        1 Reply Last reply Reply Quote 0
                        • I
                          Ilocans last edited by

                          Is it possible there is a problem with the api for the stats ?
                          It seems to be stuck since a few hours witht he same information:
                          {“currblk”:122949,“khs”:5947057.792,“retblk”:122976,“blkstoret”:27,“exptimeperblk”:134.76666666667,“nowdiff”:181.57472645,“nextdiff”:186.30479827282,“timetoret”:3638.7,“days”:0,“hours”:1,“min”:0,“sec”:38,“totcm”:24589800}

                          It is not the same info than the stats who is maybe also stuck…

                          Thanks

                          1 Reply Last reply Reply Quote 0
                          • wrapper
                            wrapper Moderators last edited by

                            [quote name=“Ilocans” post=“38054” timestamp=“1385845619”]
                            Is it possible there is a problem with the api for the stats ?
                            It seems to be stuck since a few hours witht he same information:
                            {“currblk”:122949,“khs”:5947057.792,“retblk”:122976,“blkstoret”:27,“exptimeperblk”:134.76666666667,“nowdiff”:181.57472645,“nextdiff”:186.30479827282,“timetoret”:3638.7,“days”:0,“hours”:1,“min”:0,“sec”:38,“totcm”:24589800}

                            It is not the same info than the stats who is maybe also stuck…

                            Thanks
                            [/quote]

                            Hi Ilocans, there is problem with the site, (reported last night). Hoping that is going to back up soonest.

                            1 Reply Last reply Reply Quote 0
                            • I
                              Ilocans last edited by

                              Hi Bushstar,

                              Are you planning to add new features in your api ?
                              I am working on an android application already using it to get value of what I mined.

                              I would like to know if it is possible to get:

                              • Network hashrate for the past few hours or days (and we could specify the how long in parameter),
                              • Difficulty for the past few hours or days (and we could specify the how long in parameter),
                              • Value in currency the past few hours or days (and we could specify the how long in parameter),
                              • Address balance details: all received coins with the date and all sent coins with date for an address.

                              I think theses features could be usefull not only for me.

                              Thanks.

                              1 Reply Last reply Reply Quote 0
                              • wrapper
                                wrapper Moderators last edited by

                                Hi Ilocans,

                                did this all the API stuff get sorted? or you awaiting (0.8.5) release to die down? If so I’ll message Bush and see what he thinks is in the pipeline.

                                1 Reply Last reply Reply Quote 0
                                • E
                                  eaxvac Regular Member last edited by

                                  Hi,

                                  I’m wondering if you need the price of FTC by the minute? I currently have some scripts run under Windows Azure, and 3 VM instances to handle the caches & returning of data via Java 7. I have around 2 weeks worth of data so far, I will try to fill up the gap by getting past data from sites like BitCoinWisdom…

                                  I don’t mind removing the query check and publicizing the API just for Feathercoin :P
                                  [url=http://bitbothost.cloudapp.net:8080/?Type=Chart&hours=168&depth=21&nonce=1390032751754&currencypair=ftc_btc&serverAuthorization=ZoM/jrcjdePmbiSr2Zb4uwK2v9M=&ExchangeSite=BTCe]http://bitbothost.cloudapp.net:8080/?Type=Chart&hours=168&depth=21&nonce=1390032751754&currencypair=ftc_btc&serverAuthorization=ZoM/jrcjdePmbiSr2Zb4uwK2v9M=&ExchangeSite=BTCe[/url]

                                  1 Reply Last reply Reply Quote 0
                                  • E
                                    estrabd Regular Member last edited by

                                    Out of curiosity, was there consideration about making the API more REST-y? There are cases where query string parameters are okay in the REST approach, but it by and large eliminates all that URL noise.

                                    1 Reply Last reply Reply Quote 0
                                    • First post
                                      Last post