Output with Code Snippets stays blank

[ad_1]

Hi WPGetAPI devs,

first of all, great tool! I’m currently trying to set it up to fetch some data from beaconcha.in, but it seems that I’m making some mistakes. I’m using the plugin to get the queue data from beaconcha.in. Works fine so far, it’s exactly outputting what I’m asking for:

Array
(
    [status] => OK
    [data] => Array
        (
            [beaconchain_entering] => 91534
            [beaconchain_exiting] => 0
            [validatorscount] => 619897
        )

)

As in your tutorial on YouTube/your website, I then tried to output the data through Code Snippets. Outputting just the whole variable with var_dump works and displays the whole array, but when trying to just output the beaconchain_entering value with echo, it doesn’t show anything. That’s the code I put into Code Snippets:

<?php

$bcqueue = wpgetapi_endpoint( 'beaconchain', 'queue' );

echo $bcqueue['beaconchain_entering'];
;

?>

My API setup should be fine too: (image link if embed doesn’t work)

Any idea what I’m missing? As a warning, I’m not a dev or very familiar with PHP/HTML and just know some basics.

Thanks for your help!

  • This topic was modified 5 hours, 25 minutes ago by cornlinger.
  • This topic was modified 5 hours, 22 minutes ago by cornlinger.
  • This topic was modified 5 hours, 20 minutes ago by cornlinger.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer