Results 1 to 2 of 2

Thread: JSON API in WORDPRESS

  1. #1
    Thread Starter
    Expired Customer arisma's Avatar
    Join Date
    Mar 2017
    Posts
    84
    Thanks
    9
    Thanked 0 Times in 0 Posts

    JSON API in WORDPRESS

    Hi everyone!

    I'm trying to fetch some API data of a URL but I'm pretty stuck with wordpress -.-

    I got this url for example: https://api.coinmarketcap.com/v1/ticker/bitcoin/
    And I want to display the "price_usd" on a wordpress page!

    But HOW?

    Should I use php for fetching the data? Does anyone have a solution/code ?

  2. #2
    Expired Customer wishie's Avatar
    Join Date
    Jan 2014
    Location
    Australia
    Posts
    48
    Thanks
    0
    Thanked 1 Time in 1 Post
    Holy thread resurrection batman!

    <?php

    $data = json_decode(file_get_contents("https://api.coinmarketcap.com/v1/ticker/bitcoin/"), true);
    echo $data['0']['price_usd']

    ?>

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Json optimize
    By tradeamillion in forum Mapsupreme
    Replies: 2
    Last Post: November 9th, 2015, 01:46 PM
  2. Dimitris RSS/JSON View for Listings
    By cdrake118 in forum Help Using Vantage (Legacy)
    Replies: 2
    Last Post: February 28th, 2014, 10:24 AM
  3. JSON For Categories
    By verbomedia in forum Report ClassiPress Bugs
    Replies: 1
    Last Post: October 19th, 2012, 08:08 PM