Skip to main content
Rownix's Blog
Toggle menu
Overview

Get a Free Bilibili Image Host in 1 Minute

January 18, 2026
6 min read

⚠️ Disclaimer: This article is for technical learning and research only. Do not use it for any illegal purpose or abusive behavior. You must comply with applicable laws/regulations and the platform’s terms of service. Any consequences caused by improper use are solely your responsibility.


Technical principle

At its core, this is a technique that leverages characteristics of Bilibili’s image upload interface. By calling Bilibili’s public upload API, you can store image assets on Bilibili’s servers and take advantage of its CDN to distribute content globally, resulting in fast and stable hotlinkable image URLs.

How to call the API

API endpoint

POST https://api.bilibili.com/x/upload/web/image

Request example

Terminal window
curl -X POST "https://api.bilibili.com/x/upload/web/image" \
-H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" \
-b "SESSDATA=your_SESSDATA;bili_jct=your_BILI_JCT" \
-F "bucket=live" \
-F "csrf=your_BILI_JCT" \
-F "[email protected];filename=image.png"

How to get SESSDATA and BILI_JCT

  1. Open the Bilibili homepage and make sure you are logged in.
  2. Press F12 to open your browser devtools.
  3. Switch to the Application tab.
  4. In the left sidebar, go to Storage → Cookies and select the *.bilibili.com domain.
  5. Find SESSDATA and BILI_JCT in the cookie list. The Value field is what you need.

Parameter notes

ParameterTypeDescription
SESSDATACookieBilibili user session identifier
bili_jctCookieBilibili CSRF token
bucketFormDataStorage bucket; typically set to live
csrfFormDataCSRF check; value is the same as bili_jct
fileFormDataImage file

Response format

{
"code": 0,
"message": "success",
"data": {
"image_url": "http://i0.hdslb.com/bfs/album/104c4f1ae6b66d78a5952a191281ec7883dc5c5c.jpg",
"image_width": 818,
"image_height": 1000
}
}

Response fields

FieldTypeDescription
codeIntegerStatus code; 0 means OK
messageStringResponse message
image_urlStringImage URL
image_widthIntegerImage width (pixels)
image_heightIntegerImage height (pixels)

Image style parameters explained

Bilibili’s image host supports real-time processing via URL parameters, including resizing, cropping, format conversion, and quality compression.

Common style examples

Style typeURL formatNotes
OriginalbaseURL/example.jpgKeep original size and quality
Compress quality (same res)baseURL/example.jpg@1e_1c.jpgSame resolution, lower quality
Fixed width, auto heightbaseURL/example.jpg@104w_1e_1c.jpgFixed width, proportional scaling
Fixed height, auto widthbaseURL/example.jpg@104h_1e_1c.jpgFixed height, proportional scaling
Fixed w/h + compressbaseURL/example.jpg@104w_104h_1e_1c.jpgFixed dimensions + quality compression
WebP (smallest)baseURL/example.jpg@1e_1c.webpWebP at original resolution
WebP with sizebaseURL/example.jpg@104w_104h_1e_1c.webpWebP at fixed dimensions

Parameter grammar

Pattern:

(image_original_url)@(\d+[whsepqoc]_?)*(\.(webp|gif|png|jpg|jpeg))?$

Parameter reference

ParameterRangeDescription
w[1, 9223372036854775807]Width in pixels
h[1, 9223372036854775807]Height in pixels
s[1, 9223372036854775807]Unknown parameter (needs further research)
e[0, 2]Resize mode (resize)
• 0: keep aspect ratio, choose the smaller value
• 1: keep aspect ratio, choose the larger value
• 2: do not keep aspect ratio (cannot be used with c)
p[1, 1000]Scale factor; default 100 (cannot be used with c)
q[1, 100]Image quality; default 75
o[0, 1]Unknown parameter (needs further research)
c[0, 1]Crop mode (clip)
• 0: default
• 1: crop mode

Format suffix

Supported formats:

  • webp - recommended; smallest size
  • png - lossless
  • jpeg / jpg - lossy compression
  • gif - animated format
  • If omitted, the original format is preserved

Notes

  1. Parameters are case-insensitive
  2. If the same parameter appears multiple times, the last one wins
  3. The computed width×height must not exceed the original image size, otherwise the width/height parameters will not take effect
  4. WebP is recommended for the best compression ratio

bilibili-img-uploader

This is a mature browser extension that has been running stably for 6 years, providing an easy way to upload images to Bilibili and get shareable links.

Project info

Supported platforms

BrowserInstall
ChromeChrome Web Store
EdgeChrome Web Store
FirefoxFirefox Add-ons

Key features

Automatic cookie reading - no need to manually configure SESSDATA and bili_jct
Multiple output formats - supports WebP, JPEG, PNG, etc.
Live preview - preview before uploading
Batch upload - upload multiple images at once
Quick copy - one-click copy for image links
Short link generation - converts to Bilibili short links

Web version

If you do not want to install a browser extension, there is also a web version:

Local development

Terminal window
# Install deps
pnpm install
# Dev mode (HMR)
pnpm run dev
# Production build
pnpm run build

After building, enable Developer Mode on chrome://extensions/ and load the extension folder.


⚠️ Important notes

API stability warning

According to the project’s issue history, Bilibili adjusted the image upload interface in December 2023, which shortened the validity period of the returned image links to 45 minutes. Although the project has since updated to use the new interface, you should still keep in mind:

  1. Availability is not guaranteed - Bilibili may change or close the interface at any time
  2. Permanence is not guaranteed - keep local backups for important images
  3. Do not abuse it - large-volume uploads can lead to account restrictions
  • SESSDATA and bili_jct are sensitive; keep them safe
  • Do not enter cookies on public computers or untrusted websites
  • Change your Bilibili password regularly to protect your account

Bilibili’s image host has hotlink protection. If you embed images directly on other sites, they may fail to load. Here are two approaches:

Option 1: Disable referrer site-wide

Add this in your HTML <head>:

<meta name="referrer" content="no-referrer" />

Then all requests from your site will not carry the referrer header.

For a single link, you can use rel="noreferrer":

<a href="IMAGE_URL" rel="noreferrer" target="_blank">
<img src="IMAGE_URL" alt="Description" />
</a>

Note: window.open will include referrer by default, so you need special handling.


References

Most of the technical info in this post comes from:


Acknowledgements

Thanks to @xlzy520 and all contributors for maintaining and updating this project over the years. If you find it useful, consider giving it a ⭐.


One more reminder: This document is only for technical research and learning. Please follow platform rules and use these techniques legally and responsibly. Any consequences caused by abuse are solely your responsibility.

Share

Copy the link or open a social platform to share.

💬

Comments