> ## Documentation Index
> Fetch the complete documentation index at: https://edgeful.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# screener pubsub

> live stream of screener data for the requested market and session. sends the current data immediately on connect, then pushes updates as prices change. each event is a JSON object keyed by ticker symbol.



## OpenAPI

````yaml /openapi-public.json get /screener_pubsub
openapi: 3.1.0
info:
  title: Edgeful API
  description: >-
    Public API reference for Edgeful market analysis calculations. The bearer
    token is your Edgeful API key: paste the key itself in the docs playground.
    Report responses include row-level output in `detailed` only when your plan
    includes row-level detail.
  version: 1.0.0
servers:
  - url: https://api.edgeful.com
    description: Production
security:
  - BearerAuth: []
tags:
  - name: reports
  - name: live data
paths:
  /screener_pubsub:
    get:
      tags:
        - live data
      summary: screener pubsub
      description: >-
        live stream of screener data for the requested market and session. sends
        the current data immediately on connect, then pushes updates as prices
        change. each event is a JSON object keyed by ticker symbol.
      operationId: stream_screener_pubsub_screener_pubsub_get
      parameters:
        - name: market_type
          in: query
          required: true
          schema:
            type: string
            description: >-
              type of market to stream data for. use `all` to stream stocks and
              futures together.
            enum:
              - all
              - stock
              - futures
            title: Market Type
          description: >-
            type of market to stream data for. use `all` to stream stocks and
            futures together.
        - name: session_name
          in: query
          required: false
          schema:
            type: string
            description: trading session to subscribe to; one of `NY`, `LONDON`, `ASIA`.
            enum:
              - NY
              - LONDON
              - ASIA
            default: NY
            title: Session Name
          description: trading session to subscribe to; one of `NY`, `LONDON`, `ASIA`.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
            text/event-stream:
              schema:
                type: string
              example: >+
                data: {"market_status":"market
                hours","ES":{"gap_fill_standard_100":{"current_price":5275.25,"historical_probability":0.64}}}

        '403':
          description: Valid API key, but the current plan does not include live data.
          content:
            application/json:
              examples:
                live_data_not_allowed:
                  summary: Live data not included on Essential
                  value:
                    detail:
                      detail: >-
                        Live data is not available on your current plan. Please
                        upgrade to the Pro or All Access plan to gain access.
                      code: live_data_not_allowed
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl --no-buffer --request GET \
              --url 'https://api.edgeful.com/screener_pubsub?market_type=<market_type>' \
              --header 'Authorization: Bearer <api-key>'
        - lang: python
          label: Python
          source: >-
            import requests


            url =
            "https://api.edgeful.com/screener_pubsub?market_type=<market_type>"

            headers = {"Authorization": "Bearer <api-key>"}


            response = requests.get(url, headers=headers, stream=True)

            for line in response.iter_lines():
                if line:
                    print(line.decode())
        - lang: javascript
          label: JavaScript
          source: >-
            const url =
            "https://api.edgeful.com/screener_pubsub?market_type=<market_type>";


            const response = await fetch(url, {
              method: "GET",
              headers: { Authorization: "Bearer <api-key>" },
            });


            const reader = response.body.getReader();

            const decoder = new TextDecoder();


            while (true) {
              const { done, value } = await reader.read();
              if (done) break;
              console.log(decoder.decode(value));
            }
        - lang: php
          label: PHP
          source: >-
            <?php

            $ch =
            curl_init("https://api.edgeful.com/screener_pubsub?market_type=<market_type>");

            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");

            curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer
            <api-key>"]);

            curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);

            curl_setopt($ch, CURLOPT_BUFFERSIZE, 1);

            curl_setopt($ch, CURLOPT_WRITEFUNCTION, function($ch, $data) {
                echo $data;
                ob_flush();
                flush();
                return strlen($data);
            });

            curl_exec($ch);

            curl_close($ch);
        - lang: go
          label: Go
          source: |-
            package main

            import (
                "bufio"
                "fmt"
                "net/http"
            )

            func main() {
                req, _ := http.NewRequest("GET", "https://api.edgeful.com/screener_pubsub?market_type=<market_type>", nil)
                req.Header.Set("Authorization", "Bearer <api-key>")
                resp, _ := http.DefaultClient.Do(req)
                defer resp.Body.Close()
                scanner := bufio.NewScanner(resp.Body)
                for scanner.Scan() {
                    fmt.Println(scanner.Text())
                }
            }
        - lang: java
          label: Java
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;
            import java.io.BufferedReader;
            import java.io.InputStreamReader;

            HttpClient client = HttpClient.newHttpClient();
            HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create("https://api.edgeful.com/screener_pubsub?market_type=<market_type>"))
                .header("Authorization", "Bearer <api-key>")
                .method("GET", HttpRequest.BodyPublishers.noBody())
                .build();
            HttpResponse<java.io.InputStream> response = client.send(
                request, HttpResponse.BodyHandlers.ofInputStream());
            try (BufferedReader reader = new BufferedReader(
                    new InputStreamReader(response.body()))) {
                reader.lines().forEach(System.out::println);
            }
        - lang: ruby
          label: Ruby
          source: >-
            require "net/http"

            require "uri"


            uri =
            URI("https://api.edgeful.com/screener_pubsub?market_type=<market_type>")

            request = Net::HTTP::Get.new(uri)

            request["Authorization"] = "Bearer <api-key>"


            Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme ==
            "https") do |http|
              http.request(request) do |response|
                response.read_body do |chunk|
                  print chunk
                end
              end
            end
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Use your Edgeful API key as the bearer token. In the API Reference
        authorization drawer, paste only the key (for example,
        `ef_live_<random>`).

````