Access the Oversold portfolio and its latest weekly trades with an API key tied to your Oversold account.
Example response{
"api_version": "v1",
"week_of": "2026-07-27",
"positions": [
{
"ticker": "AES",
"allocation_pct": 25,
"entry_date": "2026-07-27",
"entry_price": 14.83,
"quantity": 842.886
}
],
"recent_trades": [
{
"action": "entry",
"side": "buy",
"ticker": "AES",
"effective_date": "2026-07-27",
"execution_price": 14.83,
"quantity": 842.886,
"status": "executed"
}
]
}
Connectimport json
from urllib.request import Request, urlopen
url = "https://oversold.ai/api/v1/portfolio"
request = Request(url, headers={
"Authorization": "Bearer YOUR_API_KEY"
})
with urlopen(request) as response:
portfolio = json.load(response)
for position in portfolio["positions"]:
print(position["ticker"], position["allocation_pct"])
const url = "https://oversold.ai/api/v1/portfolio";
const response = await fetch(url, {
headers: { Authorization: "Bearer YOUR_API_KEY" }
});
if (!response.ok) {
throw new Error("API request failed: " + response.status);
}
const portfolio = await response.json();
console.table(portfolio.positions);
package main
import (
"encoding/json"
"fmt"
"net/http"
)
func main() {
request, err := http.NewRequest("GET", "https://oversold.ai/api/v1/portfolio", nil)
if err != nil { panic(err) }
request.Header.Set("Authorization", "Bearer YOUR_API_KEY")
response, err := http.DefaultClient.Do(request)
if err != nil { panic(err) }
defer response.Body.Close()
var portfolio map[string]any
if err := json.NewDecoder(response.Body).Decode(&portfolio); err != nil {
panic(err)
}
fmt.Println(portfolio["positions"])
}
The snapshot publishes after the Monday market open in America/New_York. Check last_updated_datebefore acting so your integration can confirm it has the newest portfolio.