Datastream - access: Barcelona and Madrid Libraries only through LSEG Workspace (formerly Refinitiv Workspace) has 88 country and regional total market indices (DS mnemonics: TOTMKUK, TOTMKUS, TOTMKFR etc.), and the datatype Market Value/Cap (MV or X(MV)~U$ for US dollars).
Use Bloomberg (access to Barcelona Library Financial Room). Type WCAP into the command line for a listing of market cap by country.
The database Orbis provides market capitalization and outstanding shares. Pull up your company, and choose "Stock Data" and "Security and Price Information" under the tab "Display a Specific Section."
WRDS - use Compustat or CRSP.
Also access via Passport, select Economies > Economy, Finance and Trade > In “Search Tree”, select Finance > Go. Click on the Arrow and then, select Market Capitalisation.
Market capitalization of listed companies is available as part of World DataBank
World Federation of Exchanges provides annual, YTD (year-to-date), and monthly statistics on 53 regulated exchanges around the world. Many individual exchanges will also provide statistics on their market capitalization.