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
PYTHON
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'])
Hashtag monitoring
Search
- Telegram
- Twitter
- Instagram
- Threads
- Youtube
- Tiktok
based on hashtag