That's very difficult to know. So much depends on the mechanism of the keyboard and generation of manufacture. Most times when I was working at an authorized Apple Service Center, they would replace the whole topcase. But you can shop around your local authorized service technicians, and be sure to properly identify your keyboard if it is built-in to your Mac as far as what model and vintage model it is:
How to find your Mac's model and age? - Apple Community
If it is the built-in keyboard, the cost of an external USB keyboard is always much less.