PPC associate with nice API

Hello,
I’m working in a company, which is developing a search service, and I need to find a good partner(s) for pay per click ads.
I would appreciate greatly if you could point me to partner(s), who offers a good API for targeted ads.
Just to make it clearer, the flow would be something like:
(our user types query -> we send keywords to partner -> partner returns targeted ads -> user gets our result page with ads -> profit)
And latency is quite a big issue.
PS. I’m also interested in good affiliate programs with similar functionalities

Original post by Felder