Hi @Badr , you're doing the right thing by using the Graph API. I assume you followed this document? The issue here is that the Graph API doesn't do so well with such a large amount of data. You'll have to adjust the query to account for this. The best place to start would be paging. You can break your request into smaller parts so that it won't crash on you.
Please let me know if you have any questions and I can help you further.
If this answer helps you please mark "Accept Answer" so other users can reference it.