How can I search by relationship in Contact.get?
This is going to require a second api call, first to retrieve a list of relationships for the 2nd contact, use a php loop to turn the list of relations into an array, and then you can add that to the original api call like

'id' =&gt; array('IN', $related_contact_ids)

PS. I'm not sure if the contact api3 supports this syntax.