How Does PiWik Store Keywords and Can I Acceess Them?

I apologize if this has been answered before but I searched and couldn’t find anything. Basically I would like to know how PiWik handles keywords, where they are stored and how I can access them.

Let me give you an example to explain what I mean better.

Example:

User goes to Google and types in “Plum” and visits my site, PiWik records that the visitor came to my site from Google by searching for the word “Plum”.

My question is does PiWik store the keyword “Plum” in a session or cookie that I can access in my code?

Basically I’m trying to find a way to capture the keyword the user came from in my own code but since PiWik already does this I can hopefully tap into where they store that value and use it in my own code.

Hopefully that makes sense but to summarize.

  1. User goes to google types in “plum” and visits my site
  2. PiWik tracks that the user came from Google using the word “plum”
  3. Can I somehow access the word “Plum” that this user used to get to my website using PiWik (Session, Cookie)?

If you need more info I’ll try to dumb it down some more.

Thanks

Use the API to get the keywords, eg. http://piwik.org/docs/analytics-api/reference/#Referers

keywords stored in the table piwik_log_visit.referer_keyword