According to the website of the Catalunya Government, the only requisite to be entitled to a medical card is registration on the padrón of a town in the Autonomous Region. And provide legal ID, so passport or ID card.
You can apply for a medical card at your local health centre CAP (Centro de Attención Primaria).
In the Basque Country, you need to have been on the padrón for at least one year, and meet the income requisites, about which you need to sign a ‘declaración responsable’ /auto-assessment form. Your income cannot exceed the ‘Renta Básica para la Inclusión’, which in the Basque Country is approx. 650 euros/month.
You need to visit your local health centre and apply under Decree 114/2012 from the 26th of June 2012. Bring padrón certificate, passport, possibly legislation letter. And copies.
You will get a stamped copy back that will serve as your temporary health card, valid for 3 months, during which your application will be processed by the regional health authorities.