How to consume the Stack Exchange API in Angular

176 Views Asked by At

I have call below API to get list of answers in angular 6 but I'm getting response null.

API: https://api.stackexchange.com/docs/answers#order=desc&sort=activity&filter=default&site=stackoverflow

Do I need to pass any header param ?

Does anyone have any idea on how to call the stack-exchange API in angular 6 ? Please help me if you know.

1

There are 1 best solutions below

5
HariHaran On

Here's the url that i used https://api.stackexchange.com/2.2/answers?site=stackoverflow&order=desc&sort=activity&filter=default

enter image description here

You can apply these filters via query params

I have also created a stackblitz where you can see the response in the console