San Marino is a tiny country of only 61 km2 located in the middle of Italy. There is no need to buy a local SIM card, as it's covered by Italian networks too.
The only operator San Marino Telecom (SMT) used to sell prepaid SIM cards under the brand of Prima, but discontinued all mobile services in 2016 when it was sold to TIM Italia. It now exists as separate unit of TIM called TIM San Marino. It's the only landline operator in the country and only mobile provider that is allowed to deploy antennas in the area of the country.
All other Italian operators (Vodafone, WindTre and Iliad) "cover" San Marino by antennas from outside of San Marino broadcasting into the area. Only TIM gives native coverage in San Marino and should be your preferred choice for the best coverage.
San Marino has an unique role in Europe what EU roaming rules are concerned. It's one of the few territories that are not part of the EU or EEA where EU rules legally apply. After the closure of SMT in 2016 San Marino discontinued its own network using the MCC (Mobile Country Code) 292. TIM San Marino has integrated its local San Marino network fully within TIM Italia using Italy's MCC 222 for its antennas in San Marino too. Through the MCC other operators recognize EU-affiliation and thereby consider San Marino as an EU/EEA area without leaving an expensive gap.
That's why San Marino informally applies Roam like home rules in the EU without surcharges like any other EU country. Like the Vatican in Rome San Marino is not mentioned anymore in an own article and has become part of the Italy chapter now. Locally you only have the choice to buy an Italian SIM card. TIM or any other reseller working on the TIM Italia network like Coop Voce or Kena Mobile should be your first choice when you need good coverage within San Marino.
The only operator in this tiny country was called "Prima" provided by the state-owned San Marino Telecom (SMT). In May 2016 Prima was sold to TIM and taken off the air with its own mobile service suspended. This brought an end to a special mobile coverage in San Marino.
Consult our Italy article and choose an Italian provider instead.