Open Source Surveillance API
This is documentation regarding Open Source Surveillance system - https://os-surveillance.io
Search
- Social media
- Events
- Crimes
- Critical Infrastructure
- Public Cameras
- Internet Exposed Devices
- Wifi networks
- Transportation system
- News
- and more
based on coordinates
Search
- Telegram
- Twitter
- Instagram
- Threads
- Youtube
- Tiktok
based on hashtag
Base URL
Production:
https://osint.os-surveillance.io/api
Location
Below script
- Creates new workspace with coordinates in New York by making request to /addCoordinates
- Search Flickr and Vkontakte posts in provided coordinates and bounding box by making request to /search
- Ask for task status by making request to /getProgress/{search_id}
- Retrieve search results when it's ready by making request to /getSearchResults/{search_id}
- More informatoin here https://github.com/woj-ciech/os_surveillance-api
import requests
import timeheaders = {
"Authorization": "Bearer XXXX",
"Content-Type": "application/json"
}
BASE_URL = "https://osint.os-surveillance.io/api"modules_to_run = ["flickr", "vkontakte"]#Add new workspace to the databasedef add_workspace(): url = BASE_URL + "/addCoordinates/"
payload = {
"title": "New York",
"position": {
"lat": 40.72020796700515,
"lng": -74.0401684945897
},
"radius": 30000
}
response = requests.post(url, headers=headers, json=payload)
workspace_id = response.json()['workspace_id']
return workspace_id #Search for data in the workspace#pass workspace_id from add_workspace()#include latitude, longitude and bounding box of the areadef search(wokspace_id):
url = BASE_URL + f"/search/" payload = {
"options":
modules_to_run,
"keywords":None,
"date_from":None,
"date_to":None,
"only_new":False,
"coordinates_id":wokspace_id,
"lat":40.71846412371451, # center latitude
"lng":-73.99740740984262, # center longitude
"ne_lat":40.74334880686837, # north east latitude
"ne_lng":-73.81237074710944, # north east longitude
"sw_lat":40.67945984569057, # south west latitude
"sw_lng":-74.16341826297858 # south west longitude
}
response = requests.request("POST", url, headers=headers, json=payload)
search_pk = response.json()['search_pk']
return search_pk#Check progress of the search request def get_progress(search_pk):
url = BASE_URL + f"/getProgress/{search_pk}/" response = requests.request("GET", url, headers=headers)
return response.json()#Get results of the search requestdef get_results(search_pk):
url = BASE_URL + f"/getSearchResults/{search_pk}/" response = requests.request("GET", url, headers=headers)
r_json = response.json()
return response.json()def check_errors():
url = BASE_URL + "/checkErrors/" response = requests.request("GET", url, headers=headers)
return response.json()['errors'] pp = get_progress("21")workspace_id = add_workspace()
search_pk = search(workspace_id) # next time when searching in this area, use same workspace_idwhile True:
progress = get_progress(search_pk)
print(progress['progress'])
if progress['progress'] == 100.0:
results = get_results(search_pk)
break
else:
time.sleep(1)for result in results:
for item in result['objects']:
print(item)
# print(item['title'])
# print(item['timestamp'])
# print(item['photo_url'])
# print(item['location'])
What made this section unhelpful for you?
Add Workspace
Create new workspace based on latitude, longitude and radius. Title is also mandatory.
Maximum radius is 3000000m.
Header Parameters
Authorization token
Body Parameters
string
object
Show child attributes
number (in meters) Minimum 30000
Response
Response Attributes
Response Attributes
What made this section unhelpful for you?
Response
{
"workspace_id": 1,
"error": false
}
What made this section unhelpful for you?
Search
Run modules for given workspace and coordinates.
You must provide centre of your search and bounding box.
Bounding box must be inside of the bounding box as defined in Workspace.
Options parameter contains list of modules to run.
- flickr
- vkontakte
All modules are described in Modules section.
Possible error messages:
- Please active your account.
- Coordinates are not in the bounding box
- Bounding box is not inside the workspace bounding box
Header Parameters
Body Parameters
Show child attributes
Not used anymore
Not used anymore
Not used anymore
workspace_id
Center latitude
Center longitude
(Optional) zoom
Response
Response Attributes
ID of search request
List of blocked modules due to lack of credits
Response Attributes
What made this section unhelpful for you?
Response
{
"search_pk": 31,
"blocked_modules": [],
"error": false
}
What made this section unhelpful for you?
Get progress
Get progress of the running modules.
Header Parameters
Path Parameters
The unique identifier of the task for which progress is being requested.
Response
Response Attributes
Response Attributes
What made this section unhelpful for you?
Response
{
"completed": 3,
"total": 14,
"progress": 21.428571428571427
}
What made this section unhelpful for you?
Get search results
Get search results after all or some modules finished
Header Parameters
Path Parameters
The unique identifier for the search request that was made in order to retrieve the search results.
Response
Response Attributes
Show child attributes
What made this section unhelpful for you?
Response
[
{
"type": "flickr",
"objects": [
{
"id": 1001,
"location": {
"lat": 38.652979,
"lng": -90.543491
},
"person": [],
"date_created": "2024-04-10T17:30:13.705414Z",
"notes": "",
"url": "https://flickr.com/photos/51035555243@N01/53355907945/",
"is_favorite": false,
"title": "Barack Obama Elementary School",
"photo_id": "53355907945",
"user_id": "51035555243@N01",
"photo_url": "https://live.staticflickr.com/65535/53355907945_06ef423980_n.jpg",
"timestamp": "2014-08-22T08:56:34",
"coordinates": 11,
"search_request": 36,
"type": "flickr"
},
{
"id": 528,
"location": {
"lat": 38.652979,
"lng": -90.543491
},
"person": [],
"date_created": "2024-04-10T17:44:15.252128Z",
"notes": "",
"url": "https://vk.com/id445558837?z=photo445558837_457239108",
"is_favorite": false,
"owner_id": "445558837",
"photo_url": "https://sun9-5.userapi.com/impg/c856124/v856124951/1d4a89/RjSOMbb6J5E.jpg?size=810x1080&quality=96&sign=2b6a5f336aff30dccb079a46db5c7141&c_uniq_tag=EEVVc6KKBZBmjbdiffkVqKdOc0vrlOdMk911R-BbUUE&type=album",
"photo_id": "457239108",
"text": "",
"timestamp": "2020-01-22T16:48:45Z",
"coordinates": 11,
"search_request": 36,
"type": "vkontakte"
}
]
},
{
"type": "vkontakte",
"objects": [
{
"id": 528,
"location": {
"lat": 38.652979,
"lng": -90.543491
},
"person": [],
"date_created": "2024-04-10T17:44:15.252128Z",
"notes": "",
"url": "https://vk.com/id445558837?z=photo445558837_457239108",
"is_favorite": false,
"owner_id": "445558837",
"photo_url": "https://sun9-5.userapi.com/impg/c856124/v856124951/1d4a89/RjSOMbb6J5E.jpg?size=810x1080&quality=96&sign=2b6a5f336aff30dccb079a46db5c7141&c_uniq_tag=EEVVc6KKBZBmjbdiffkVqKdOc0vrlOdMk911R-BbUUE&type=album",
"photo_id": "457239108",
"text": "",
"timestamp": "2020-01-22T16:48:45Z",
"coordinates": 11,
"search_request": 36,
"type": "vkontakte"
}
]
}
]
What made this section unhelpful for you?
Check errors
Some modules might not run properly, to find out which ones; endpoint checkErrors needs to be queried, after get progress returned all tasks as done.
Include previously obtained “search_pk”
Path Parameters
Response
Response Attributes
What made this section unhelpful for you?
Response
{
"errors": []
}
What made this section unhelpful for you?
Additional endpoints
Below endpoints provide additional features like get workspaces, user information, database search or querying particular item.
Hashtag monitoring
Search
- Telegram
- Twitter
- Instagram
- Threads
- Youtube
- Tiktok
based on hashtag