Skip to content

Commit

Permalink
improved method search()
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanExtreme002 committed Dec 25, 2023
1 parent 2a66152 commit 25f902c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/FlightRadar24/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"""

__author__ = "Jean Loui Bernard Silva de Jesus"
__version__ = "1.3.21"
__version__ = "1.3.22"

from .api import FlightRadar24API, FlightTrackerConfig
from .entities import Airport, Entity, Flight
4 changes: 2 additions & 2 deletions python/FlightRadar24/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,11 @@ def get_zones(self) -> Dict[str, Dict]:

return zones

def search(self, query: str) -> Dict:
def search(self, query: str, limit: int = 50) -> Dict:
"""
Return the search result.
"""
response = APIRequest(Core.search_data_url.format(query), headers = Core.json_headers)
response = APIRequest(Core.search_data_url.format(query, limit), headers = Core.json_headers)
results = response.get_content().get("results", [])
stats = response.get_content().get("stats", {})

Expand Down
2 changes: 1 addition & 1 deletion python/FlightRadar24/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Core(ABC):
most_tracked_url = flightradar_base_url + "/flights/most-tracked"

# Search data URL
search_data_url = flightradar_base_url + "/v1/search/web/find?query={}&limit=50"
search_data_url = flightradar_base_url + "/v1/search/web/find?query={}&limit={}"

# Flights data URLs.
real_time_flight_tracker_data_url = data_cloud_base_url + "/zones/fcgi/feed.js"
Expand Down

0 comments on commit 25f902c

Please sign in to comment.