Adding sites dynamically

Hello,
is there a way to add sites dynamically using php, and widgets.
basically the site is a .php file, and depending on the id field (like .php?id=5), it displays different contents.

I want for each id that exists, a separate site in piwik, so every id is separate from each other in analytics.

thanks

Use the REST API. see http://piwik.org/docs/analytics-api/reference/