Router Scan is an open API project with partially open source code.
Here are some code samples:

/src/demoapp/demo.dpr-source code of a console application demonstrating LibRouter API usage.
/src/demoapp/LibRouter.pas-LibRouter API headers for Delphi.