Download OpenAPI specification:Download
API to access FloodTags data, meant for the querying, export and editing of 'Tags' and 'Events', for the purpose of visualizing the data and implementing FloodTags data in custom front-end solutions.
The API consists of the following base endpoints:
If you're looking to develop a custom solution based on the FloodTags API, it may also help to login to the FloodTags Dashboard, and use your browser's developer tools to inspect all requests to api.floodtags.com, to get an idea how the API can be used from a front-end.
Note that the API is designed for implementation in front-ends, and rate-limits apply. On average, you should not send more than 1 request every 2 seconds. To receive bulk data, please contact FloodTags at info@floodtags.com
Query the events detected by FloodTags, and return the results in one or more representations (views)
views required | Array of strings non-empty Items Enum: "events" "locations" Example: views=events One or more representations in which to return the queried data. Please see the 'response schema' under the '200' response code below to find a description of each view. |
sources | Array of strings non-empty Example: sources=spanish-flood-news,english-flood-news The data-sources for which to return data. Find the list of authorized sources for your account at /user?views=sources. (required if 'ids' is not provided) |
date.since | string <date-time> Example: date.since=2020-02-02T12:34:33Z Beginning of time range for query (including/gte, required if 'ids' is not provided) |
date.until | string <date-time> Example: date.until=2020-02-02T12:35:33Z End of time range for query (excluding/lt, required if 'ids' is not provided) |
ids | Array of strings <= 50 items Example: ids=ev-123456789,ev-987654321-edited-4s3546d6w8 Query for events with these ids (Note: url parameters, other than views/format-related ones, are ignored) |
labels | Array of strings Example: labels=Recent Flood,Damages Mentioned Query by these user-added labels. Note that if labels contain commas, these should be double encoded (e.g. %252C). To achieve this, first URL encode each label (e.g. with this function, then join the array using comma's, and then URL encode it again. |
not.labels | Array of strings Example: not.labels=Incorrect Location,Unrelated Filter query results by exluding items that have these user-added labels. The same formatting conventions as for the 'labels' parameter apply. |
location.id | string Example: location.id=g-8837749 Return only data that have a location with this ID |
location.bbox | Array of numbers = 4 items Example: location.bbox=4.17698,52.01303,4.46404,52.11796 Return only data with locations within this bounding box (order:west,south,east,north) |
location.parent.id | Array of strings <= 10 items Example: location.parent.id=g-8839948 Return only items that have locations with either these ids, or one of these IDs in their lists of parent locations |
view.events.limit | integer [ 0 .. 100 ] Default: 10 The number of results to show per page (Only for tag view) |
view.events.skip | integer [ 0 .. 10000 ] Default: 0 The result at which to start for paging (offset) |
{- "status": "success",
- "errors": [ ],
- "total": 1,
- "data": {
- "events": [
- {
- "id": "ev-121123454654",
- "start": "2021-05-10T12:33:12Z",
- "end": "2021-05-11T12:59:59Z",
- "counts": {
- "english-flood": 16,
- "french-flood": 38
}, - "location": {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 10.98361,
- 44.5444
]
}, - "severeness": 7,
- "properties": {
- "name": "Emilia-Romagna",
- "id": "g-3177401",
- "parents": [
- "g-3177401",
- "g-3175395"
], - "type": "adm4"
}
}, - "mergedFrom": [
- "ev-345223454653"
], - "labels": [ ]
}
], - "locations": [
- {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 10.98361,
- 44.5444
]
}, - "properties": {
- "name": "Emilia-Romagna",
- "id": "g-3177401",
- "parents": [
- "g-3177401",
- "g-3175395"
], - "type": "adm4",
- "total": 1
}
}
]
}
}
Export the query results to a CSV or GeoJSON file
sources | Array of strings non-empty Example: sources=spanish-flood-news,english-flood-news The data-sources for which to return data. Find the list of authorized sources for your account at /user?views=sources. (required if 'ids' is not provided) |
date.since | string <date-time> Example: date.since=2020-02-02T12:34:33Z Beginning of time range for query (including/gte, required if 'ids' is not provided) |
date.until | string <date-time> Example: date.until=2020-02-02T12:35:33Z End of time range for query (excluding/lt, required if 'ids' is not provided) |
ids | Array of strings <= 50 items Example: ids=ev-123456789,ev-987654321-edited-4s3546d6w8 Query for events with these ids (Note: url parameters, other than views/format-related ones, are ignored) |
labels | Array of strings Example: labels=Recent Flood,Damages Mentioned Query by these user-added labels. Note that if labels contain commas, these should be double encoded (e.g. %252C). To achieve this, first URL encode each label (e.g. with this function, then join the array using comma's, and then URL encode it again. |
not.labels | Array of strings Example: not.labels=Incorrect Location,Unrelated Filter query results by exluding items that have these user-added labels. The same formatting conventions as for the 'labels' parameter apply. |
location.id | string Example: location.id=g-8837749 Return only data that have a location with this ID |
location.bbox | Array of numbers = 4 items Example: location.bbox=4.17698,52.01303,4.46404,52.11796 Return only data with locations within this bounding box (order:west,south,east,north) |
location.parent.id | Array of strings <= 10 items Example: location.parent.id=g-8839948 Return only items that have locations with either these ids, or one of these IDs in their lists of parent locations |
format required | string Enum: "csv" "geojson" In which format to export the event data |
"string"
Edit events in the FloodTags system, by changing/adding one or more fields of an event (Currently only supports adding labels and changing name). Note that after editing, ongoing events are no longer updated (e.g. end-date extended)
ids required | Array of strings <= 50 items Example: ids=ev-123456789,ev-987654321-edited-4s3546d6w8 Apply the operation to events with these ids |
The fields to replace in the event data
labels | Array of strings |
name | string |
end | string |
{- "labels": [
- "Flood Related",
- "Contains Damage"
]
}
{- "status": "success",
- "errors": [ ],
- "idUpdates": {
- "ev-123456789": "ev-123456789-edited-4s3546d6w8"
}
}
Delete events in the FloodTags system (For your user or user-group only)
ids required | Array of strings <= 50 items Example: ids=ev-123456789,ev-987654321-edited-4s3546d6w8 Apply the operation to events with these ids |
{- "status": "success",
- "errors": [ ]
}
Get the user-specific data of the current user (user information, settings etc.)
views required | Array of strings non-empty Items Enum: "info" "settings.dashboard" "settings.notifications" "settings.custom" "authorization" "sources" "labels.tags" "labels.events" "apikey" Example: views=info,settings.dashboard The type of data to return for the user. See response data for details about each |
{- "status": "success",
- "errors": [ ],
- "data": {
- "info": {
- "name": "John Smith",
- "email": "johnsmith@floodtags.com",
- "organization": "FloodTags",
- "country": "The Netherlands"
}, - "authorization": {
- "date": {
- "since": "1970-01-01T00:00:00Z",
- "until": "2100-01-01T00:00:00Z",
- "ranges": [
- {
- "since": "1970-01-01T00:00:00Z",
- "until": "1971-01-01T00:00:00Z"
}, - {
- "since": "2023-01-01T00:00:00Z",
- "until": "2100-01-01T00:00:00Z"
}
]
}, - "sources": [
- "english-flood",
- "indonesian-flood"
], - "functions": [
- "view",
- "export",
- "edit",
- "delete"
]
}, - "settings": {
- "dashboard": {
- "defaultQuery": {
- "sources": [
- "english-flood"
], - "date": {
- "since": "now - 48h",
- "until": "now"
}, - "labels": [ ],
- "not": {
- "labels": [ ]
}, - "contains": [
- "locations"
], - "filters": [
- "high_keyword_score",
- "with_flood_related_photos"
], - "customFilters": [
- "Only churches"
]
}, - "visibleSources": [
- "english-flood",
- "french-flood",
- "english-flood-news"
], - "customFilters": [
- {
- "name": "Only churches",
- "query": "church | cathedral | mosque",
- "visible": true
}
], - "baseMap": "OSM",
- "showTermsOfService": false
}
}, - "sources": [
- {
- "id": "english-flood",
- "name": "English",
- "language": "en",
- "type": "twitter",
- "filters": {
- "tags": [
- {
- "id": "only_detailed_locations",
- "name": "Exclude Country Level",
- "description": "Excludes tags that only have the country level location detected"
}, - {
- "id": "only_most_detailed_locations",
- "name": "Only Most Detailed Locations",
- "description": "Show only the most detailed locations for each tag (e.g. if both a city and the country it's in are detected, only the city is shown)"
}, - {
- "id": "high_keyword_score",
- "name": "Flood Related",
- "description": "Shows only Tags about floods, based on keyword analysis"
}, - {
- "id": "with_flood_related_photos",
- "name": "With Flood Photos",
- "description": "Shows only tags that have one or more images that were classified as flood related by machine learning"
}
]
}
}
], - "labels": {
- "tags": [
- "support",
- "damages"
], - "events": [
- "large",
- "withCasualties"
]
}
}
}
Edit the user data
operation | string Default: "update" Enum: "update" "replace" Whether the request body should be used to update existing data, or completely replace it. If for example only 'settings.dashboard.defaultQuery' is in the request body, and this is set to 'update', only the lowest level keys that are given inside the 'settings.dashboard.defaultQuery' object are updated in the user data. If this is set to 'replace', the complete 'dashboard.settings' object is replaced, meaning it will only contain the 'defaultQuery' object with the provided contents. |
The fields to replace in the event data
object (settingsSchema) |
{- "settings": {
- "dashboard": {
- "defaultQuery": {
- "sources": [
- "english-flood"
], - "date": {
- "since": "now - 48h",
- "until": "now"
}, - "labels": [ ],
- "not": {
- "labels": [ ]
}, - "contains": [
- "locations"
], - "filters": [
- "high_keyword_score",
- "with_flood_related_photos"
], - "customFilters": [
- "Only churches"
]
}, - "visibleSources": [
- "english-flood",
- "french-flood",
- "english-flood-news"
], - "customFilters": [
- {
- "name": "Only churches",
- "query": "church | cathedral | mosque",
- "visible": true
}
], - "baseMap": "OSM",
- "showTermsOfService": false
}
}
}
{- "status": "success",
- "errors": [ ]
}
Request specific features and/or configurations from FloodTags
A JSON object describing the request subject and details
subject required | string Value: "api-key" The subject of the request |
{- "subject": "additional-sources",
- "details": "Facebook, Instagram, Youtube"
}
{- "status": "success",
- "errors": [ ]
}