Inspiration

Current events.

What it does

The backend API uses the endpoint "/country/:id" to retrieve the latest news data for a particular country from newsapi.org. This data is then fed to OpenAI through a request prompt. The AI is prompted to analyze the sentiment of the combined articles, responding with either positive, neutral or negative. In addition, the AI is also prompted to give a stability score from 1-100.

How we built it

I used express.js to make this api. The api features the axios library for making the necessary HTTP requests, and cors middleware to make potential front-end integration seamless.

Challenges we ran into

I intended on making this a full-stack web application with angular for the front-end. I'm happy to have learned how to use an AI API, and how to pair it with external data. I am fascinated at the potential of this technology.-end. I envisioned an app that would use the leaflet library to render a map of the world, and use the AI data retrieved from express.js to color index countries based on their stability score. If a user were to click on a country, the app would render a country-details component providing the details that informed the AI's judgment. In addition to gathering news data, I would have loved to also implement government, economics, and armed conflict data to better inform the stability score. Unfortunately I was not able to get the front-end service connected to the back-end in time.

Accomplishments that we're proud of

Although I don't have a client-side to visually articulate the data, I am happy with how effective the back-end is on its own.

What we learned

I'm happy to have learned how to use an AI API, and to effectively pair it with external data. I am fascinated at the potential of this technology, and excited to implement it in a future project.

What's next for Global Stability API

Front-end integration.

Built With

Share this project:

Updates