i have latitude and longitude of a location and i want to find nearby transit info of that location, just like how google does it on there google maps detail page.
There is no API for Google Transit unfortunately. You could probably scrape the output but this would likely violate Google's Terms of Service.
There are a few Transit authorities who provide APIs - if you want to cover a very specific area you might be able to go direct. Have a look at Programmable Web's Travel category.