Api integration
Unanswered
American black bear posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
American black bearOP
i have backend in python and i want to integrate api in this ans want to use redux-toolkit as well and i my app directory not src directory. Do i need to create api directory for handing api or do i simple write in client component ?
8 Replies
![Avatar](https://cdn.discordapp.com/avatars/998522171813011486/301889edae1fdb98789ce7188f03ca16.webp?size=256)
Santhosh Prabhakaran
If you want to create api directory to fetch the data, you can do that. Or else you can simply fetch the data from the server components
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
American black bearOP
@Santhosh Prabhakaran for api directory how to use getStaticPath or getStaticParams ?
![Avatar](https://cdn.discordapp.com/avatars/998522171813011486/301889edae1fdb98789ce7188f03ca16.webp?size=256)
Santhosh Prabhakaran
You said app directory and why are you using getStaticPath or getStaticParams ?
Those are NextJS 12 versions
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
American black bearOP
could you please let me know how to integrate api . i am using this version of nextjs "next": "13.1.6",
![Avatar](https://cdn.discordapp.com/avatars/998522171813011486/301889edae1fdb98789ce7188f03ca16.webp?size=256)
Santhosh Prabhakaran
In NextJS 13 versions there is no functions like getStaticPath or getStaticParams
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
American black bearOP
then which is best approach to make api call ?
![Avatar](https://cdn.discordapp.com/avatars/998522171813011486/301889edae1fdb98789ce7188f03ca16.webp?size=256)
Santhosh Prabhakaran
To get the path and params, you don't need to use these functions. In NextJS 13 ,those things can be get as params in server components. Go through this doc. It will help you
https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating
https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating