Skip to main content
v1 Deprecation: Sectors Financial API v1 will be deprecated and discontinued at the end of March 2026. Please migrate to v2 as soon as possible.

Overview

Migrating from Sectors Financial API v1 to v2 is straightforward for most endpoints. The v2 API offers improved performance, better data structures, enhanced filtering capabilities, and natural language query support.

General Migration Pattern

For most endpoints, migration is as simple as updating the URL path from /v1/ to /v2/:
https://api.sectors.app/v1/...
While most endpoints follow this pattern, some endpoints have been redesigned with enhanced functionality. See the sections below for specific migration paths.

Endpoint-Specific Migrations

The following endpoints have improved functionality in v2 and require specific migration instructions:

1. Companies by Index

v1 Limitation: Could only query from a single index at a time.
GET https://api.sectors.app/v1/index/{index}/
Benefits:
  • Query multiple indices simultaneously
  • Use natural language queries for easier filtering
  • More flexible filtering with SQL-like syntax
Example:
import requests

url = "https://api.sectors.app/v2/companies/"
headers = {"Authorization": "YOUR_API_KEY"}

# Method 1: SQL-style filtering
params = {"where": "indices in ['idxbumn20', 'lq45']"}
response = requests.get(url, headers=headers, params=params)

# Method 2: Natural Language Query
params = {"q": "find me all companies in lq45 and/or idxbumn20"}
response = requests.get(url, headers=headers, params=params)

2. Top Companies Ranked

v1 Limitation: Limited to specific classifications: dividend_yield, total_dividend, revenue, earnings, market_cap, pb, pe, ps.
GET https://api.sectors.app/v1/companies/top/?classification=revenue&year=2023
Benefits:
  • Sort by any available metric, not just predefined classifications
  • Combine sorting with advanced filtering
  • Specify year or quarter for time-series data
  • More flexible and powerful queries
Example:
import requests

url = "https://api.sectors.app/v2/companies/"
headers = {"Authorization": "YOUR_API_KEY"}

# Basic ranking by revenue for 2023
params = {"order_by": "-revenue[2023]"}
response = requests.get(url, headers=headers, params=params)

# Ranking with sector filter
params = {
    "order_by": "-revenue[2023]",
    "where": "sub_sector='banks'"
}
response = requests.get(url, headers=headers, params=params)

3. Top Companies by Growth

v1 Limitation: Limited growth metrics and filtering options.
GET https://api.sectors.app/v1/companies/top-growth/?min_mcap_billion=4000
Benefits:
  • More granular growth metrics
  • Natural language queries for complex filters
  • Combine multiple filters easily
  • Negative sign (-) for descending order
Example:
import requests

url = "https://api.sectors.app/v2/companies/"
headers = {"Authorization": "YOUR_API_KEY"}

# Method 1: Direct sorting by growth
params = {"order_by": "-yoy_quarter_revenue_growth"}
response = requests.get(url, headers=headers, params=params)

# Method 2: Natural Language Query
params = {"q": "give me the top growing banking companies by revenue in 2024"}
response = requests.get(url, headers=headers, params=params)

Key Improvements in v2

Natural Language Queries

Use the q parameter to query data using plain English, making complex filters easier to write.

SQL-like Filtering

Use the where parameter with SQL-like syntax for precise, powerful filtering.

Flexible Sorting

Sort by any available metric using order_by, with support for time-series data.

Better Performance

Optimized query engine delivers faster responses and handles complex queries efficiently.

Migration Checklist

1

Audit Your v1 Usage

Review all v1 endpoints currently in use in your application.
2

Update Base URLs

Change /v1/ to /v2/ for standard endpoints.
3

Refactor Special Endpoints

Update the three special endpoints (Companies by Index, Top Companies Ranked, Top Companies by Growth) using the examples above.
4

Test Thoroughly

Test all endpoints in a development environment to ensure responses match expectations.
5

Deploy

Roll out the migration to production before the v1 deprecation deadline (end of March 2026).

Need Help?