Pulling the data from social network built on elgg

we have created our own social network on elgg. for analysis of our social network we want to get all the activities of the users based on authentication using an api similar to graph api provided by facebook for its developers.

How to create an application and get the public and private key ?

How to get authentication for fetching the data.

thank you