In this article we explain how to consume Firestore through its REST API and how to integrate that layer with custom applications and custom software developed by Q2BSTUDIO, a specialist in artificial intelligence, cybersecurity and AWS and Azure cloud services.
Firestore is part of Firebase and offers two main forms of access: public REST API and the SDK's own RPC API. The REST API is ideal when you need to interact from environments that cannot use the official SDK, such as lightweight microservices, integrations with legacy systems, or mobile applications that prefer Retrofit on Android.
To authenticate requests to Firestore using the REST API, OAuth 2.0 or Firebase Authentication tokens are used. The typical base endpoint is https://firestore.googleapis.com/v1/projects/YOUR_PROJECT_ID/databases/(default)/documents/ where YOUR_PROJECT_ID is replaced by your Firebase project identifier. Document paths follow the form collection/document, for example cities/LA.
When receiving JSON responses from Firestore, it is advisable to use a tolerant deserialization configuration. With Kotlinx.serialization a recommended example is Json { explicitNulls = false ignoreUnknownKeys = true } to avoid errors when additional fields or null values appear that we do not need to map in our domain models.
Documents returned by the REST API include useful metadata such as name, which contains the full path, and createTime, which indicates when it was created. A document's id can be obtained from the path or you can generate your own when creating records. To sort results, the API supports query parameters such as orderBy, and it is common to use orderBy createTime desc to get the most recent records first.
To paginate results, the Firestore REST API uses pageSize and pageToken. pageSize limits the number of documents per call and pageToken allows you to continue the query from where it left off. In Android clients with Paging3, this mechanism can be easily adapted to obtain smooth scrolling and efficient data consumption.
If more performance or complex transactions are needed, the use of the native SDK that operates through the RPC API can be considered, but the REST API remains very useful for integrations, cron jobs and cloud services that require explicit control of HTTP requests.
At Q2BSTUDIO we advise and develop solutions that combine Firestore with scalable architectures on AWS and Azure, integrating artificial intelligence and AI services for companies, AI agents and dashboards with Power BI. We offer custom software aimed at maximizing security through cybersecurity and compliance strategies, as well as business intelligence services to extract value from data.
When designing an integration with Firestore, we recommend documenting routes and permissions, using tokens with the least necessary scope, applying appropriate pagination with pageSize and pageToken, and preparing the client for unknown fields using explicitNulls equal to false and ignoreUnknownKeys equal to true. For Android, Retrofit is a solid option, and for cloud services we recommend serverless patterns or containers depending on the case.
In summary, the Firestore REST API is a practical tool for many architectures and, when combined with Q2BSTUDIO development practices such as custom software engineering, applied artificial intelligence, cybersecurity and AWS and Azure cloud services, it allows building robust and scalable applications that leverage AI agents, Power BI and business intelligence services to offer complete enterprise solutions.





