I am new to flutter/Dart and I want to get data from an API. I don’t know how to get the JSON schema from the API. I don’t find it in the documentation.
This is the API I want to connect to. https://rapidapi.com/realtymole/api/realty-mole-property-api
I have written code from an example using this JSON: https://jsonplaceholder.typicode.com/posts
but this site already has the json available so I can convert the json to dart.
How do I use this API in my flutter project?
Any help would be appreciated
2
Answers
You can use the Quicktype service to generate the required Dart models out of the example JSON responses of different endpoints provided in the API documentation.
You can use these packages to connect with API and get response.
Dio package
http Package
And after getting your JSON response use can use Quicktype to convert JSON into dart model. Hope it helps.