How to print Json data from Facebook in a block?
Normally I would look for a contributed module that might already be written, but at this time none of Drupal for FaceBook, FaceBook Like Button, Views FaceBook Like, FaceBook Social, or Social Media Links have Drupal 8 releases. It would be a good idea to look at contributing to the above projects.

In order to accomplish this, you will need to create a Block plugin in a custom module. There are a few of options. Code examples are sort of pseudo-codeish.


Contribute and port one of the modules above to Drupal 8.
In PHP, you may use Guzzle in the build method in the block plugin. The advantage here is that the block will be cached and save performance on subsequent loads.


```

$client = \Drupal::service('http_client');
$options = [
  'query' =&gt; [
    'query' =&gt; "select like_count from link_state where url = 'http://drupal.stackexchange.com/'",
    'format' =&gt; 'json'
];
$response = $client-&gt;request('https://api.facebook.com/method/fql.query', $options);
// the "serializer" service could also be used if deserializing into a known Drupal typed data type.
$data = json_decode($response-&gt;getBody());


```


You may also add a JavaScript asset to the render array of the block, and then code some JavaScript that makes a request. The advantage here is that this is that this is done after Drupal render, but it will make an additional http request on each page load. 


```

(function($, Drupal) {
  Drupal.behaviors.myModule = {
    attach: function(context, settings) {
      $.ajax('https://api.facebook.com/method/fql.query?query=select%20like_count%20from%20link_stat%20where%20url=%27http://drupal.stackexchange.com/%27&amp;format=json', {
        dataType: 'json'
      }).done(function(data) {

      });
    }
  };
})(jQuery, Drupal);


```