Tricking the Nasdaq API to talk to your python code in JSON

Johan Louwers
2 min readApr 16, 2024

When people need to download ticker symbols from Nasdaq, many will attempt to access the API endpoint. For instance, making a request to this endpoint provides a comprehensive JSON response containing information about all ticker symbols trading on Nasdaq.

However, while you can easily view this JSON response in your browser, attempting the same operation with Python may encounter an issue. The Nasdaq server might become unresponsive, leading to delays and waiting times.

import requests

def tickersNasdaq():
url = ""
response = requests.get(url)

# Example usage

The above code will result in a unresponsive logic.

Be a human not a machine

The problem is that the API is checking for the user agent, if we prentend to be a human and not code the Nasdaq server will respond without fail. The below code will work without any problem as we ‘fake’ that we are a human user by defining a user_agent.

import requests




Johan Louwers

Johan Louwers is a technology enthousiasts with a long background in supporting enterprises and startups alike as CTO, Chief Enterprise Architect and developer.