I want to do an API call inside function node without using HTTP node can anyone show me an example

You would need to use a suitable library in your n8n instance (and allow using them via the NODE_FUNCTION_ALLOW_EXTERNAL environment variable) and will then be able to make http requests in your Function node. You can find an example snippet here: