Skip to main content

ADA Sentiment Explorer Python API

Project description

logo

ADA Sentiment Explorer API

Introduction

Alpha Data Analytics ("ADA") is a data analytics company, core product is ADA Sentiment Explorer (“ADASE”), build on an opinion monitoring technology that intelligently reads news sources and social platforms into machine-readable indicators. It is designed to provide unbiased visibility of people's opinions as a driving force of capital markets, political processes, demand prediction or marketing

ADA's vision is to democratise advanced AI-system supporting decisions, that benefit data proficient people and small- or medium- quantitative institutions.

ADASE supports keyword and topic engines, as explained below

To install

pip install adase-api

Sentiment Open Query

To use API you need to provide API credentials as environment variables and search topic

from adase_api.schemas.sentiment import Credentials, QuerySentimentTopic
from adase_api.sentiment import load_sentiment_topic

credentials = Credentials(username='youruser@gmail.com', password='yourpass')

search_topics = ["inflation rates", "OPEC cartel"]
ada_query = QuerySentimentTopic(
  text=search_topics,
  credentials=credentials
)
sentiment = load_sentiment_topic(ada_query)
sentiment.tail(10)
                          score                    coverage                
query               OPEC cartel inflation rates OPEC cartel inflation rates
date_time                                                                  
2024-01-12 03:00:00    0.170492       -3.210051   -0.270801        1.600013
2024-01-12 04:00:00    0.184400       -0.621429   -0.270801        1.600013
2024-01-12 05:00:00    0.170492        0.952482   -0.270801        0.414950
2024-01-12 06:00:00    0.170492       -0.114074   -0.270801        0.414950
2024-01-12 07:00:00    0.170492        0.804350   -0.270801        0.414950
2024-01-12 08:00:00    0.170492        0.241445   -0.270801        1.600013
2024-01-12 09:00:00    0.170492        1.548717   -0.270801        3.970140
  • Returns coverage and score (sentiment) to a pandas DataFrame.
  • When normalize_to_global=True data comes more sparse, since query hits most likely won't be found every hour.
  • In this case missing records, both coverage and score are filled with 0's
  • coverage field is usually seasonal, is adviced to apply a 7-day rolling average
  • By default, is queried live data, that comes on an hourly basis and includes 6 months history

Search topic syntax

  1. Plain text
    • In contrast with keyword search, plain text relies on topics to query data on wider concept. It works the best when 2-5 words describe some concepts, examples:
      • "stock market", it might also analyse terms as "Dow Jones", "FAANG" etc.
      • "Airline travel demand"
      • "Energy disruptions in Europe"
      • "President Joe Biden"
    • analysed scope depends on how words normally co-occur together

  2. Boolean search
    • Search for exact keyword match
    • Each condition is placed inside of round brackets (), where
      • + indicates a search term must be found
      • and - excludes it
    • For example "(+Ford +Motor*), asterix * will include both Motor & Motors
import pandas as pd

search_topics = ["(+inflation)"]
ada_query = QuerySentimentTopic(
    text=search_topics,
    credentials=credentials,
    languages=['de', 'ro', 'pt', 'pl'],
    live=False,
    start_date=pd.to_datetime('2010-01-01')
)

This query will do a boolean search on historical data starting from Jan 1, 2010 and include only data in specified languages

Mobility Index

Monitor traffic (on the road) situation on the city-to-airport pairs

Besides the news monitoring, the package also provides interface to query worldwide real-time traffic situation. This can be useful in the combination with media or standalone.

from adase_api.schemas.geo import QueryTagGeo, GeoH3Interface, QueryTextMobility, QueryMobility
from adase_api.geo import load_mobility_by_text

q = QueryTextMobility(
    tag_geo=QueryTagGeo(text='Gdansk'),
    geo_h3_interface=GeoH3Interface(),
    mobility=QueryMobility(aggregated=False)
)
mobility = load_mobility_by_text(q)

API rate limit

All endpoints have set limit on API calls per minute, by default 10 calls / min.

In case you don't have yet the credentials, you can sign up for free

  • Data available since January 1, 2001
  • Easy way to explore or backtest
  • In a trial version data lags 24-hours
  • Probably something else? Hopefully the data can inspire you for other use cases

You can follow us on LinkedIn

Questions?

For package questions, rate limit or feedback you can reach out to info@adalytica.io

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adase-api-0.3.4.tar.gz (46.6 kB view details)

Uploaded Source

Built Distribution

adase_api-0.3.4-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file adase-api-0.3.4.tar.gz.

File metadata

  • Download URL: adase-api-0.3.4.tar.gz
  • Upload date:
  • Size: 46.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.7

File hashes

Hashes for adase-api-0.3.4.tar.gz
Algorithm Hash digest
SHA256 58885c8cce3c4221bc4250177077ecda0988e204aad67c6ab552fe3ddc23e954
MD5 d10065e5eb6a092c609b11986f825201
BLAKE2b-256 bbd46f2ee779c0cb03236dec956f9146755a68f8da11cb88260caf00d57d7c10

See more details on using hashes here.

File details

Details for the file adase_api-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: adase_api-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 23.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.7

File hashes

Hashes for adase_api-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 56833489ed1e6382eb498d8e2622ab5b24794bcd3aa222d701315f6b8bfefee2
MD5 590952b80a9b9c5adf1b4b93a7b73c3b
BLAKE2b-256 d57afea8c437dc41a91f7cb4e5a0374fd612ebd9d01aeb18a082bd6ec6b59e11

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page