diff --git a/README.md b/README.md
index c5d7681..2ad26ae 100644
--- a/README.md
+++ b/README.md
@@ -28,3 +28,15 @@ The list of endpoints then looks like the following:
 * `/jsonapi/node/article/{UUID}`: Exposes an individual article
 * `/jsonapi/block`: Exposes a collection of blocks
 * `/jsonapi/block/{block}`: Exposes an individual block
+
+## Development usage
+
+It is also possible to obtain the JSON representation of a supported entity:
+
+  // For a given $entity object.
+  $json_output = \Drupal::service('jsonapi.resource.to_json', ['resource' => $entity])->json();
+
+Should it be needed, the raw string itself can be obtained:
+
+  // For a given $entity object.
+  $json_output = \Drupal::service('jsonapi.resource.to_json', ['resource' => $entity])->raw();
diff --git a/jsonapi.services.yml b/jsonapi.services.yml
index a9f0788..5ebad74 100644
--- a/jsonapi.services.yml
+++ b/jsonapi.services.yml
@@ -106,6 +106,10 @@ services:
       # middleware (priority 200)has the opportunity to respond.
       - { name: http_middleware, priority: 201 }
 
+  jsonapi.resource.to_json:
+    class: Drupal\jsonapi\Controller\ToJson
+    arguments: ['resource']
+
   logger.channel.jsonapi:
     parent: logger.channel_base
     arguments: ['jsonapi']
diff --git a/src/Controller/ToJson.php b/src/Controller/ToJson.php
new file mode 100644
index 0000000..d04d59d
--- /dev/null
+++ b/src/Controller/ToJson.php
@@ -0,0 +1,72 @@
+<?php
+
+namespace Drupal\jsonapi\Controller;
+
+use Drupal\Core\Controller\ControllerBase;
+use Drupal\Component\Serialization\Json;
+use Drupal\Core\Entity\EntityInterface;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpKernel\HttpKernelInterface;
+
+/**
+ * Provide JSON output for a given object.
+ */
+class ToJson extends ControllerBase {
+
+  /** @var object */
+  protected $resource;
+
+  /**
+   * {@inheritDoc}
+   */
+  public function __construct($resource) {
+    $this->resource = $resource;
+  }
+
+  /**
+   * Return the requested resource as a JSON object.
+   *
+   * @param array $options
+   *   Any additional arguments to be passed to the HTTP request.
+   *
+   * @return Drupal\Component\Serialization\Json
+   *   The requested resource in JSON form.
+   */
+  public function json(array $options = []) {
+    return Json::decode($this->raw($options));
+  }
+
+  /**
+   * Return the requested resource as a raw string.
+   *
+   * @param array $options
+   *   Any additional arguments to be passed to the HTTP request.
+   *
+   * @return string
+   *   The raw JSON string of the requested resource.
+   */
+  public function raw(array $options = []) {
+    // @todo Rewrite this to use internal APIs instead of a HTTP request.
+
+    // @todo Do we really want to support this shortcut?
+    if ($this->resource instanceof EntityInterface) {
+      $this->resource = "/{$this->resource->getEntityTypeId()}/{$this->resource->bundle()}/{$this->resource->uuid()}";
+    }
+
+    /** @var \Symfony\Component\HttpKernel\HttpKernelInterface $kernel */
+    $kernel = \Drupal::service('http_kernel.basic');
+
+    $request = Request::create('/jsonapi/' . ltrim($this->resource, '/'), 'GET', $options + ['_format' => 'api_json']);
+
+    // @todo Drop this hack when https://www.drupal.org/node/2613044 is done.
+    $previous_request = \Drupal::requestStack()->getCurrentRequest();
+
+    // @todo Find a nicer implementation with maybe less layers involved.
+    $response = $kernel->handle($request, HttpKernelInterface::SUB_REQUEST, TRUE);
+
+    \Drupal::requestStack()->push($previous_request);
+
+    // @todo How to take into account cacheability metadata.
+    return $response->getContent();
+  }
+}
diff --git a/tests/src/Functional/JsonApiFunctionalToJsonTest.php b/tests/src/Functional/JsonApiFunctionalToJsonTest.php
new file mode 100644
index 0000000..651059e
--- /dev/null
+++ b/tests/src/Functional/JsonApiFunctionalToJsonTest.php
@@ -0,0 +1,43 @@
+<?php
+
+namespace Drupal\Tests\jsonapi\Functional;
+
+use Drupal\Component\Serialization\Json;
+use Drupal\Tests\BrowserTestBase;
+
+/**
+ * Test the ToJson functionality.
+ *
+ * @group jsonapi
+ */
+class JsonApiFunctionalToJsonTest extends BrowserTestBase {
+
+  /**
+   * {@inheritDoc}
+   */
+  public static $modules = [
+    // Core dependencies.
+    'node',
+
+    // This module.
+    'jsonapi',
+  ];
+
+  /**
+   *  Check the output of the system service.
+   */
+  public function testService() {
+    $node = $this->createNode();
+
+    $string = \Drupal::service('jsonapi.resource.to_json', ['resource' => $node])->raw();
+    $this->verbose(print_r($string, TRUE));
+    $this->assertFalse(empty($string));
+
+    $json = \Drupal::service('jsonapi.resource.to_json', ['resource' => $node])->json();
+    $this->verbose(print_r($json, TRUE));
+    $this->assertFalse(empty($json));
+
+    $this->assertSame(Json::decode($string), $json);
+  }
+
+}
