Pastebin

Pastebin

Cloud Storage & File Sharing

Plain Text Storage & share with unique URL.

Visit API

📚 Documentation & Examples

Everything you need to integrate with Pastebin

🚀 Quick Start Examples

Pastebin Javascript Examplejavascript
// Pastebin API Example
const response = await fetch('https://pastebin.com/api/', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/json'
    }
});

const data = await response.json();
console.log(data);

Introducing Pastebin API

Pastebin is a website where users can store and share codes with others. It provides an API for developers to interact with the platform programmatically. This blog will cover the basics of the Pastebin API and provide example code in JavaScript.

Getting started with Pastebin API

To use the API, you will need to sign up for a Pastebin account and get an API key. You can get an API key by visiting the Developer API documentation. You can then use this API key to make requests to the Pastebin API.

Pastebin API in JavaScript

Here are a few examples of how to use the Pastebin API in JavaScript:

Creating a new paste

const axios = require('axios');
const data = {
    api_dev_key: "YOUR_API_KEY",
    api_option: "paste",
    api_paste_code: "console.log('Hello, world!');",
    api_paste_name: "My New Paste",
    api_paste_expire_date: "N"
}
axios.post('https://pastebin.com/api/api_post.php', data)
  .then(function (response) {
    console.log(response.data);
  })
  .catch(function (error) {
    console.log(error);
  });

Listing pastes for a user

const axios = require('axios');
const data = {
    api_dev_key: "YOUR_API_KEY",
    api_option: "list",
    api_user_key: "USER_API_KEY"
}
axios.post('https://pastebin.com/api/api_post.php', data)
  .then(function (response) {
    console.log(response.data);
  })
  .catch(function (error) {
    console.log(error);
  });

Getting paste information

const axios = require('axios');
const data = {
    api_dev_key: "YOUR_API_KEY",
    api_option: "show_paste",
    api_paste_key: "PASTE_KEY"
}
axios.post('https://pastebin.com/api/api_post.php', data)
  .then(function (response) {
    console.log(response.data);
  })
  .catch(function (error) {
    console.log(error);
  });

These are just a few examples of how to use the Pastebin API in JavaScript. To view the full list of API methods and parameters, visit the Pastebin API documentation.

📊 30-Day Uptime History

Daily uptime tracking showing online vs offline minutes

Jul 29Jul 31Aug 2Aug 4Aug 6Aug 8Aug 10Aug 12Aug 14Aug 16Aug 18Aug 20Aug 22Aug 24Aug 2704008001440Minutes
Online
Offline

Related APIs in Cloud Storage & File Sharing