How to get the SMILES of all compounds on PubChem?

I would like to download all the compounds from [ChEMBL](https://www.ebi.ac.uk/chembl/) and [PubChem](https://pubchem.ncbi.nlm.nih.gov/classification/#hid=72). For ChEMBL this is easy using their webUI. Nevertheless, for PubChem, it isn't clear how to download all the compounds on the database including their SMILES representations.


I am also not sure how pubchem has 33,000,000 compounds where ChEMBL has "only" 2,000,000. 




The best way to download bulk data from PubChem is actually FTP, as documented in their [documentation](https://pubchemdocs.ncbi.nlm.nih.gov/downloads).


For example, if you want the unfiltered SMILES of every CID in PubChem, the URL is <ftp://ftp.ncbi.nlm.nih.gov/pubchem/Compound/Extras/CID-SMILES.gz>


You can also download subsets using the [PubChem Structure Download service](https://pubchem.ncbi.nlm.nih.gov/pc_fetch/pc_fetch.cgi)


And as mentioned above, there are Python and other tools to access both PubChem and ChemSpider through their documented web APIs.


 15