We can use any Firebase Realtime Database URL as a REST endpoint. All we need
to do is append
.json to the end of the URL and send a request from
our favorite HTTPS client.
Create an Account
First sign up for a free account in the Firebase console. A new Firebase app
will be created for you with a unique URL ending in
You'll use this URL to authenticate your users and to store and sync data to
the app's database.
Within the Firebase console you can create, manage and delete Firebase apps. Clicking on a specific Firebase app lets you view and modify your app's database in realtime. In your app dashboard, you can also set Firebase Realtime Database Rules, manage your app's authentication, deploys, and view analytics.
Create a Database
If you haven't already, create a Firebase project: In the Firebase console, click Add project, then follow the on-screen instructions to create a Firebase project or to add Firebase services to an existing GCP project.
Navigate to the Database section of the Firebase console. You'll be prompted to select an existing Firebase project. Follow the database creation workflow.
Select a starting mode for your Firebase Security Rules:
- Test mode
Good for getting started with the mobile and web client libraries, but allows anyone to read and overwrite your data. After testing, make sure to review the Understand Firebase Realtime Database Rules section.
To get started with the web, iOS, or Android SDK, select test mode.
- Locked mode
Denies all reads and writes from mobile and web clients. Your authenticated application servers can still access your database.
When you enable Realtime Database, it also enables the API in the Cloud API Manager.
Choose a Helper Library
You can read and write data through the REST API directly from the command line. In this guide we'll use cURL for all of our examples. We also have several third-party helper libraries for interacting with the REST API from your favorite language. You can use one of the following helper libraries or create your own:
|Clojure||taika by Cloudfuji|
|Dart||IO Client in the official firebase-dart library|
Firego by Steven Berlanga and Tim Gossett
Go Firebase by Cosmin Nicolaescu and Justin Tulloss
|Java||firebase4j by Brandon Gresham|
|Perl||Firebase-Perl by Kiran Kumar and JT Smith|
firebase-php by kreait
firebase-php by Tamas Kalman
|Python||Pyrebase by James Childs-Maidment
python-firebase by Özgür Vatansever
python-firebase by Michael Huynh
firebase-ruby by Oscar Del Ben
BigBertha by Fernand Galiana
rest-firebase by Codementor