Yes, Revit has an API. There is even an Revit API forum. You can use visual studio (or other IDE) to target the Revit API. With visual studio youc ould use different languages to write the code. However C# is the most common one used.
Also have a look at the buildingcoder website. Lots of information on the Revit API. THe writer of that blog is also regular visitor of the Revit API forum.
Further Revit has Dynamo. A node based scripting tool. Language used there is Python. Dynamo might be too limited if you need to code extensive scripts.
Louis
Please mention Revit version, especially when uploading Revit files.