In short. Baidu identifies the shared Baiduspider token first, then uses Android or Mobile markers for its documented mobile classification.
Definition: Desktop and mobile Baiduspider visits share the crawler name in the User-Agent header. Baidu's 25 May 2019 guidance says to identify
Baiduspiderfirst, then classify a mobile request by theAndroidorMobiletoken; a documented desktop pattern has neither token. Baidu's identification guidance describes this rule.
Key facts
- Baidu says its mobile and PC crawler User-Agent strings were unified under
Baiduspider/2.0, and both contain theBaiduspiderkeyword. The same page gives PHP and ASP examples that lowercase the header before testing it. Baidu's 25 May 2019 article - Baidu's 2019 identification article lists mobile, PC and mini-program User-Agent contexts. Its mobile examples contain
AndroidorMobile; its PC examples use eitherBaiduspider/2.0orBaiduspider-render/2.0. Baidu's User-Agent verification article - Baidu recommends two-way DNS authentication after the User-Agent check. The reverse hostname should use
*.baidu.comor*.baidu.jp, and a forward lookup must return the original request IP. Baidu's mobile search guidance
Which log tokens separate mobile from desktop?
For the rule in Baidu's program examples, the parser first normalizes the User-Agent to lowercase and searches for baiduspider. A match containing android or mobile is classified as mobile. A Baiduspider match without either token follows the PC branch in the example. The render label is insufficient by itself because Baidu lists Baiduspider-render/2.0 in both mobile and PC examples.
These are the User-Agent strings shown in Baidu's identification article:
Mozilla/5.0 (Linux;u;Android 4.2.2;zh-cn;) AppleWebKit/534.46 (KHTML,like Gecko)Version/5.1 Mobile Safari/10600.6.3 (compatible; Baiduspider/2.0;+http://www.baidu.com/search/spider.html)
Mozilla/5.0 (iPhone;CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko)Version/9.0 Mobile/13B143 Safari/601.1 (compatible; Baiduspider-render/2.0;+http://www.baidu.com/search/spider.html)
Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)
Mozilla/5.0 (compatible; Baiduspider-render/2.0; +http://www.baidu.com/search/spider.html)
The first two examples have mobile device markers. The latter two show why a parser should test the device markers after the shared crawler name.
How can a log analyst check that the visitor is Baidu's crawler?
Baidu's verification procedure starts with the source IP in the access log. A reverse DNS lookup should produce a hostname ending in baidu.com or baidu.jp; the documentation's example uses host on the IP address. The hostname is then resolved forward, and its address is compared with the original IP.
host 111.206.198.69
host baiduspider-111-206-198-69.crawl.baidu.com
The two lookups are separate from mobile or desktop classification. They establish whether the request matches Baidu's documented hostname and address check. A User-Agent string alone is therefore a log label, while the DNS result is the authentication step described by Baidu.
What does the shared name mean for robots rules?
Baidu's older mobile search guidance explicitly says that a robots restriction targeting Baiduspider applies to PC and mobile requests at the same time. The shared product token therefore cannot be used in robots.txt to allow one of these two request types while blocking the other. The mobile distinction belongs in request handling or log analysis, where Android and Mobile can be examined.
The same guidance also records the earlier mobile pattern and tells site operators to identify it with Android or Mobile, alongside Baiduspider/2.0. That wording supports keeping the crawler-family field and the device-class field separate in a log report.
Related terms
FAQ
Can a User-Agent string alone prove that a request came from Baidu?
No. Baidu's verification procedure adds reverse and forward DNS checks: the resolved hostname must use a Baidu domain pattern and resolve back to the logged IP.
Does Baiduspider-render/2.0 identify a mobile visit?
No. Baidu's examples use the render form for both mobile and PC contexts. The mobile examples also contain Android or Mobile.
Can a robots.txt rule distinguish mobile and desktop Baiduspider?
No. Baidu states that a restriction for the Baiduspider agent affects PC and mobile crawling together.
Sources
- Baidu Search Resource Platform, "如何用程序识别Baiduspider ua", 2019-05-25
- Baidu Search Resource Platform, "〖官方说法〗只需两步,正确识别百度蜘蛛(User-Agent)", 2019-05-20
- Baidu Search Resource Platform, "移动搜索", 2015-06-02
Check how a page reads to answer engines. Open the GEO score analyzer