Building a secure API

Hi there,
I need to build an API into my system which will allow other users to interact with it without login in.
I just wanted to find out what is the best way to make it secure?

I have in mind of generating a unik api key - random alpha numerical and md5 key.

Coming in the API - it will check if the key is right and alow users to interact with it.

Am i on the right track?

Regards,

Thanks a lot for any kind of help,
Jerome