I have a VCF annotated using COSMIC database VCFs where the ID column is now the COSV identifier for each variant and I also have the LEGACY ID in the INFO column.
My question is, using either identifier (COSV or LEGACY) how can I create a link to the Overview webpage for each variant?
However, please take into consideration that the Overview page is for transcript level annotations and there are cases where the COSV id (identifier at the genomic level) can refer to multiple legacy COSM ids at the transcript level. So depending on what you are interested to show it might be more appropriate to use the link of the original post to display all transcripts associated to the genomic mutation position. In my case I wanted a link to the specific variants found in my VCF.
I was in touch with COSMIC a couple of years ago about this exact issue and they said they'd make a way to link to entries directly - have they not implemented this yet? I had to point to a search page that showed results like the one you show in your post. It might be the only way for now, as you'll need to implement a complex logic involving canonical transcripts and their ENST IDs if you wish to go directly to the overview page.
You may want to check the VCF and TSV downloads for the identifier "24045458" which will take you directly to the overview page for COSV55497419/ The co-ordinates you use - GRCh37/38 - may also affect the chances of getting a direct link. If it's in there, you're in luck.