If you visit USGS earthquakes listing, you get 3 points of information for each earthquake: Location, depth, magnitude. My question is, is there a way to approximate how big of an area is affected? Like if an earthquake happens 20km from San Francisco, how strong does it have to be for someone in SF to be able to feel it?
No, there isn't, because the area affected depends on so many factors, some of them unknowable. Magnitude, cause, depth, geology (which may be very variable in different parts of the area) etc. Besides which, the easiest way to tell which areas are affected is to monitor reports from observers. In the final analysis, the data that aid agencies want to know is which areas ARE affected rather than which might theoretically be affected if all relevant factors were known, which they rarely will be.
Yes, using GMPES. E.g., you can look at the USGS shakemap which includes some measure of intensities such as PGA/PGV. Just choose an appropriate cut-off value and you have your area.