Back to APIs
Firebase
Firebase Realtime Database and Firestore provide NoSQL cloud databases with real-time sync, offline support, and auto-scaling.
Base URL
https://YOUR_PROJECT.firebaseio.comNoSQLrealtimeFirestoreGoogleoffline
Endpoints
GET
/{path}.jsonRead data at a database path.
const response = await fetch("https://YOUR_PROJECT.firebaseio.com/users/jane.json?auth=YOUR_API_KEY", {
method: "GET",
headers: {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
}
});
const data = await response.json();
console.log(data);Response Preview
{
"name": "Jane Doe",
"email": "jane@example.com",
"role": "admin",
"created_at": 1714000000000
}PUT
/{path}.jsonWrite or replace data at a database path.
const response = await fetch("https://YOUR_PROJECT.firebaseio.com/users/jane.json?auth=YOUR_API_KEY", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
},
body: JSON.stringify({
"name": "Jane Doe",
"email": "jane@example.com",
"role": "admin"
})
});
const data = await response.json();
console.log(data);Response Preview
{
"name": "Jane Doe",
"email": "jane@example.com",
"role": "admin"
}