StarCraft II profile URL path

Why not just use the API that sc2ranks.com has created. That way you can focus your efforts on building the website, and sc2ranks will deliver the data you need.

Read more about the restrictions for the service and how to use SC2 Ranks API.

EDIT

Since you do not want to use sc2ranks.com, you should take a look at the sc2profile project. It is made for the single purpose of fetching profile information from Battle.net. I think that would be a good starting point.


That number is from the user's battle.net profile URL. Example:

http://eu.battle.net/sc2/en/profile/326029/1/LiquidTLO/

http://sc2ranks.com/eu/326029/LiquidTLO

That's probably how sc2ranks gets it, but if all you have is username + character code, I don't know a way to get it without using their API like @Sharken said. However even on their website they say character code is not the most accurate way to search for a player's profile.