What is the proper way to retrieve multiple property values stored in a property name using getJSON

I'm having trouble getting multiple languages to work in my code. Could someone assist me and provide guidance on how to write multiple choices for the property name language?

When I input code like this to display only Dota 2 games in English, everything functions perfectly.

$(document).ready(function() {   
    $.getJSON( "https://api.twitch.tv/kraken/streams", 
        {
            game:"Dota 2",  
            language:'en'       
        },      
        function ( data ) {}

However, when I attempt to include more languages and use code like this, it does not work:

$(document).ready(function() {   
    $.getJSON( "https://api.twitch.tv/kraken/streams", 
    {
        game:"Dota 2",  
        language:['en', 'de', 'fr', 'it', 'ru']
    },      
    function ( data ) {}

You can view the JSON data at this link:

Answer №1

To gather information in multiple languages from the API, you will need to make separate requests for each language and then combine the resulting stream lists.

For more details, please refer to:

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilizing negative values in lineTo, strokeRect, and fillRect functions

Is it possible to input negative numbers into the drawing primitives of HTML5 canvas? For instance, if I apply a translation of (100,100), would I be able to draw a rectangle or line with coordinates (-25,-25)? Initial testing using lineTo seems inconclus ...

Steps for storing div content (image) on server

Currently in the process of developing a web application that allows users to crop images. The goal is for users to have the ability to email the URL so others can view the cropped image, ensuring that the URL remains active indefinitely by storing every c ...

React Native backhandler malfunctioning - seeking solution

Version react-native-router-flux v4.0.0-beta.31, react-native v0.55.2 Expected outcome The backhandler should respond according to the conditions specified in the backhandler function provided to the Router props. Current behavior Every time the har ...

Leveraging a JSON file for array manipulation

I am in the process of creating a program that will fetch a JSON file from a specified URL, randomly select a property, and return its value. Check out my code below: import urllib.request from urllib.request import Request import json import random url ...

JavaScript vs. markup: deciding between generating an extensive list of options or including them directly in

Recently, I encountered an issue with a .NET page that included a large number of identical dropdown lists within a repeater. Unfortunately, the rendering performance of the website was below expectations. In an attempt to improve the performance, I exper ...

Navigating the express subdomain

I'm currently utilizing the package express-subdomain. The issue is that the router handling subdomain requests is the same as the one handling non-subdomain requests. I suspect there's an error in my 'app.js' configuration. How shoul ...

Accessing the particular json item within a variable length set

Sometimes, reading a specific tag within a JSON file using Python can be tricky. The elements might not always be fixed, making it difficult to locate the desired information using sequence numbers. In such cases, relying on the consistent name of the elem ...

How to properly handle file uploads and get the correct image path from Node Js (Express) to React Js?

Currently, I am working on my local system developing a file upload feature using node js. My project file structure looks like this: Project ..client .... source code of React App ..Server ....uploads ......avatar ........image.png ....index.js In this ...

Encountering a problem with parsing a JSON object using the .map

After receiving this JSON response, my main goal is to extract the value located in the identifier. By utilizing console.log, I am able to analyze the structure of the object: Object {rows: Array[33], time: 0.015, fields: Object, total_rows: 33} fields: O ...

What is the best method for transforming this particular json document into a dataframe?

Looking for assistance in converting a json file into a data frame with multiple columns (hour, frappucino, soda, coffee, tea, water, milkshake, nothing, sandwich, pie, muffin, cookie) and ensuring the values are properly placed. If anyone is able to prov ...

Ways to handle errors when using navigator.clipboard.writeText

document.queryCommandSupported('copy') may not be available on all browsers. I experimented with the code below, which successfully copies the link on Firefox but fails on Opera. It displays an alert indicating that the code has been copied, yet ...

Exploring Vue's data binding with both familiar and mysterious input values

How can I model an object in Vue that contains both known and unknown values? The quantity is unknown, but the type is known. I need to present user inputs for each type, where the user enters the quantity. How should I approach this? data() { retur ...

Display or conceal a division underneath a dropdown menu based on selections retrieved from a SQL Server database

Presented here is my JavaScript code. function appendItemforPurchaseOrder() { debugger var rowNumber = parseInt($(".itemmapContainer").attr("data-rownumber")); rowNumber = isNaN(rowNumber) ? 1 : rowNumber + 1; var addNewItemDetailHtml = ...

App not displaying iOS push notifications

Trying to implement push notifications in my iOS7 app but encountering issues. The push notification does not appear. I have followed the process of creating certificates and provisioning profiles. Currently, it is only built for development, with plans t ...

What causes getBoundingClientRect() in Javascript to occasionally produce decimal values?

Currently, I am experimenting with an HTML5 canvas element. A major concern of mine is setting up a mousemove event to monitor the movement of the mouse over the canvas for drawing and other purposes. Unfortunately, I have not been able to locate a definit ...

Converting JSON data into an object

Here is the content retrieved from the server, {"version":3,"status":"ok","response":{"data":[{"address":"1908 Bull Temple Road","category_ids":[29],"category_labels":[["Community and Government","Education","Colleges and Universities"]],"country":"in","e ...

The Viadeo Social Toolbox seems to be encountering technical difficulties at the moment

I attempted to utilize a Viadeo Social Toolbox, specifically the Viadeo Share Button, but it seems to be malfunctioning in certain browsers? I came across some outdated viadeo share URLs like this: http://www.viadeo.com/shareit/share/?url=${url}&title ...

"Resolving the issue of Django request.FILE returning a null value

HTML Template: <form method="post" action="" enctype="multipart/form-data" class="form-group"> {% csrf_token %} <h1 class="m-3 text-center">New Post</h1> <div id="tui-image-e ...

JavaScript User Information Lookup Module

My goal: I am trying to create a function that will check if the firstName provided matches an existing contact's firstName in the contacts array, and if the prop specified is a valid property of that contact. If both conditions are met, the functio ...

Can the value of the currently selected option in a select box be obtained without needing to submit the form?

I'm currently working on a project and facing a roadblock with the following task: My goal is to extract the selected value from a dropdown menu and utilize it in my PHP script. The challenge here lies in capturing the chosen option without requirin ...