Submit URLs to Baidu in Style

Baidu introduced a fancier yet kind of geeky way of URL submission

Posted by Ryan Chooai on 2016-10-17

When submitting URLs to search engines, the two most common ways are single URL submission and sitemap submission.

For example, on Baidu:

  1. You can do a quick manual submission using our own Baidu submission tool;
  2. You can also submit your sitemap to Baidu in Baidu Webmaster Tools. This is the go-to method for most webmasters.

But this summer, Baidu introduced a fancier yet kind of geeky way of URL submission – bulk submission via the direct submission API.

By utilizing Baidu’s direct submission API, webmasters don’t have to sit there waiting for Baidu to come to your site and find new URLs on your site any more – now you can directly push new URLs to Baidu, which can potentially make the indexation process much quicker.

Isn’t that cool? Okay, we have created a simple guide to help you get started quickly.


First, you need a Baidu Webmaster Tools account. Baidu assigns each webmaster tools account a unique token, which is part of the request URL for URL submission.

You can find you own access token by going to “链接提交” in your BWT account.

For example, if your website is, your access URL will be something like:

Parameters Required Type Notes
site yes string a verified website in Baidu Webmaster Tools
token yes string Your own private token

How to Use the API – Sample Codes

Curl Example

Put the URLs in a file named urls.txt. One URL per line.

curl -H 'Content-Type:text/plain' --data-binary @urls.txt ""

HTTP Post Method Example

POST /urls? HTTP/1.1
User-Agent: curl/7.12.1
Content-Type: text/plain
Content-Length: 83

PHP Example

$urls = array(
$api = '';
$ch = curl_init();
$options = array(
CURLOPT_URL => $api,
CURLOPT_POSTFIELDS =>implode("\n", $urls),
CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
echo $result;

Ruby Example

require 'net/http'
urls = ['', '']
uri = URI.parse('')
req =
req.body = urls.join("\n")
req.content_type = 'text/plain'
res = Net::HTTP.start(uri.hostname, uri.port) { |http| http.request(req) }
puts res.body

Python Example

import requests

seed_file = open('urls.txt', 'r')
urllist = '\n'.join(seed_file.readlines())

r =

print r.text


Successful submission

{ "remain":4999998, "success":2, "not_same_site":[], "not_valid":[] }

String Required Type Notes
success yes int no. of URLs that are successfully submitted
remain yes int no. of URLs left in the daily quota
not_same_site no array not a verified site in your BWT account
not_valid no array invalid URLs submitted

Failed submission

{ "error":401, "message":"token is not valid" }

String Required Type Notes
error yes int error code, usually a 4xx HTTP status code
message yes string error description

Using WordPress or Discuz?

To simplify the URL submission process, Baidu has released official plugins for WordPress and Discuz. The plugins not only submit the site’s URLs to Baidu, but also make the submitted data in a Baidu-friendly way.

You can grab the plugins here:

Related articles:

baidu seo guide

Stay up to date