Laravel Tumblr API Integration

17 Apr 2019 . Laravel . 2.4K views

Tumblr is one of the famous microblogging and social networking website. If you are a fan of Tumblr and planning to use its official API. In this post, I mainly focus on how to integrate with Laravel.


First of all, you need to install the package with composer.

composer require tumblr/tumblr

Now run -

composer update

You have already installed the package. Now let's integrate.


Just declare a new route-

Route::get('/tumblr', '[email protected]ex');

Now you need to have api_key and secret_key to connect. You need to register it in your Tumblr Apps.

Once you have it, then go to the this link and get oauth_token and oauth_token_secret.

You probably will get something like this-

// Authenticate via OAuth
$client = new Tumblr\API\Client(

// Make the request

Now copy that code and paste in the controller, that will be like this. In this example, I am creating a new post and publish it in Tumblr.

public function create()
        $client = new Tumblr\API\Client(
        $blogName = 'name-of-your-blog';
        $data = [
            'title' => $title,
            'tags' => $tags,
            'thumbnail' => $thumbnail,
            'url' => $url,
            'type' => 'link'
        $client->createPost($blogName, $data);

Now once you browse this, you will have a new post in your Tumblr blog.

You will get the full list of Tumblr API methods here.

Thank you. :)