I do not know how to achieve this with the Google API, but I do know how to do it with the SmartyStreets Autocomplete API.
A simple GET request with the state_filter option will do what you want. Here is an example:
curl "https://autocomplete-api.smartystreets.com/suggest?prefix=Elm+St&state_filter=wa,id,or&auth-id=<your-auth-id>"
Broken out we see these parameters:
hostname: autocomplete-api.smartystreets.com
prefix: Elm St
state_filter: WA,ID,OR
auth-id: <a-valid-smartystreets-auth-id>
The prefix should be part of an address that you are looking for. The Autocomplete API is used for suggesting addresses as users type an address into an address field in a web form. But you can access it directly to achieve your stated purpose.
The results of this request would be a JSON string:
{
"suggestions": [
{
"text": "Elm St, Bellevue ID",
"street_line": "Elm St",
"city": "Bellevue",
"state": "ID"
},
{
"text": "W Elm St, Almira WA",
"street_line": "W Elm St",
"city": "Almira",
"state": "WA"
},
{
"text": "Elm St SW, Albany OR",
"street_line": "Elm St SW",
"city": "Albany",
"state": "OR"
},
// 7 other results were truncated
]
}
Note: To use any of the SmartyStreets APIs, you need a valid auth-id, which you can get easily when you signup for a free account.
(Disclaimer: I work for SmartyStreets)
Elm Stin them? - SunSparc