The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [api]

API, for code implementing (not using) an Application Programming Interface. A program's API defines the proper way for a developer to request services from that program, site and/or service.

Filter by
Sorted by
Tagged with
2
votes
0answers
71 views

Reshape GET Request to Long Data Frame in R

Overview Converting the content of the httr::GET() request from json into an r data frame required a few data manipulation steps to reshape the data to long format ...
3
votes
1answer
66 views

API calls organization in Ionic (Angular) application

I'm doing a prototype of server API calls in my Ionic (Angular) application. I'm considering this use case: ...
0
votes
2answers
147 views

Displaying the value of a stock portfolio

Some people have mentioned to me that my site is quite inefficient and given that it's taking ~17 seconds to load now, I'd like to change that but I've no idea how. I've tried Gzip to compress it but ...
2
votes
0answers
37 views

Undocumented API client / wrapper in Python

Got the go ahead to make an API wrapper for an undocumented web API. Hoping to get some feedback on my code and design choice. I've been going back and forth and haven't been able to really feel ...
1
vote
1answer
72 views

Avoid existSync function on Node.js - Express API controller

I have many json files that I want to serve through an API. The json files look something like this: ...
3
votes
1answer
138 views

PHP RESTful API for a student repository

All of the codes are based on the PSR-2 standard. Also Dependency-Injection and Repository patterns are followed. I would love to hear some advices or comments. StudentRepository Class ...
3
votes
1answer
646 views

Using Python to get data from a Star Wars API

I am learning Python (about 6 months in, sporadically) and today I decided to write a script to download JSON information from an API. To start, I wrote a one-page script with a few functions. The ...
3
votes
1answer
79 views

Symfony controller that registers a user via HTTP-POST

This is the code I have written for one of my API routes. I feel like my controller is too big and the function does too much. What can I do to make my adhere to SOLID principles and be more ...
2
votes
1answer
1k views

Node.js/Express middleware to relay requests to various APIs

I am creating a nodejs middleware server that will handle api transactions from a frontend and relay them to various api's (internal and external). The primary goal is to hide api keys from the ...
7
votes
3answers
1k views

CQS implementation with decorators

I've created a "framework" or more of a library for a CQS implementation with a few decorators. Using ASP.NET Core for the front end, I wanted an opinion about how this looks/feels. I changed the ...
7
votes
3answers
530 views

Carousel in Vanilla JavaScript

I finally got my carousel to work in JavaScript, and I want to know what you guys think about it and what I can do better. ...
4
votes
1answer
107 views

A word replacer that uses an API to check for different words to make up a new string

This is one of my first finished programs that I've written to date. I am not yet very familiar with Python, so please bear with me. I'd like to know from you: Can my code be called 'pythonic'? I'...
2
votes
1answer
908 views

Export running data from Garmin API to CSV

I'm interested in getting better. Current script does the job but I'm really unsure regarding Quality of overall structure & comments Error handling Possibility the add testing (what and how ...
0
votes
1answer
66 views

Haskell Servant - login endpoint with two error states

Here is one a handler for dealing with logins, I've recently refactored it to try and make dealing with the different error cases a bit more elegant, though I still think there is room for improvement:...
1
vote
0answers
170 views

WebSocket based API library in Julia

I made a very bare-bones API "library" in Julia which should abstract the interaction with the API. The API is fairly complex - it's based around 2 core layers an HTTPS/REST API for general ...
7
votes
1answer
215 views

ApiClient with http communication in Qt

This is my first code review request on this page. I tried to simplify my ApiClient as much as possible. The full version is also on GitHub. I thought very long about how to design the API client ...
0
votes
1answer
180 views

Wrapper class for calling external API [closed]

I have a PHP cronjob script. I need to send requests and get responses from some external API. So, there is code for the API class. In this class, I connect to the API and call public methods of ...
3
votes
1answer
134 views

Attaching Facebook messenger bot to all pages of the user logging in

I have to create open source code that allows a user to login to Facebook through an app and attaches that app's messenger bot to the user's pages. I have never written open source code before so I ...
0
votes
1answer
60 views

Translating words from one language to another

My program translates words from one language to another using a language Pivot and systran.io API. I used promises, callbacks and external API for the first time but I'm not sure that's the best way ...
2
votes
1answer
73 views

Validating list of values to be sent to API

I'm currently writing a client library to use with a courier's SOAP API to create and manage shipments. I'm using the service classes generated from the WSDL provided by the courier, their ...
2
votes
1answer
146 views

Authentication API script

I have coded a script that I run when I need to verify the authentication for a user, I use it as a php script and host it on api.mydomain.com. It just simply checks to see if the user details are ...
1
vote
0answers
32 views

Factory method to make JSON requests for various types of list items

I have the following code: ...
3
votes
1answer
68 views

Fast prototype code to hook up a webcam to the Azure Emotion API

Last week I had a 5 hours school project deadline based on the Azure Emotion API. Right now I am trying to rewrite the same code in a more clean/elegant way. I am quite new to coding so I will need ...
8
votes
2answers
834 views

Python Export Decorator

In Python, we use __all__ to explicitly denote the public API of a module or package. That looks like this: ...
2
votes
0answers
925 views

Adding support of HTTP PATCH

I have an API endpoint to modify a race car, which supports the PUT method: PUT /api/racecars/{racecarId} Since PUT must be ...
2
votes
0answers
2k views

Serial Port Wrapper with Internal Blocking Buffer

Here I have some complete working code but some aspects seem questionable to me. What I have done is written a wrapper for the Microsoft serial port (...
4
votes
2answers
514 views

Python script using Minneapolis / St. Paul Metro Transit's API to tell you how long till next bus

I have written a program which will tell you how long it is until the next bus on “BUS ROUTE” leaving from “BUS STOP NAME” going “DIRECTION” using the api defined at http://svc.metrotransit.org/. ...
3
votes
2answers
321 views

PHP class to send CRM records to Five9 API

I am experimenting with the Five9 API and setup a PHP class to deal with the addRecordstoList method. The main issue this class was meant to solve over the traditional function found in their ...
8
votes
1answer
149 views

A PHP API which has an endpoint for processing a user's facebook login details

I'm working on a PHP API for my angular JS Phonegap application. At the moment I'm focusing on working with a user's facebook public profile data. I'll explain the process a little first: The user ...
1
vote
1answer
85 views

Simple static JSON - get only - API

This API's aim is to return color-names for a bunch of hex colors. Its the first time I am writing an API. And while I write lots of frontend code I rarely touched node. I am interested in a general ...
1
vote
2answers
107 views

Materiel position query for a war game written in Unity

I am making a tank game. I have a database on a server where I store information about Tank itself, Hulls, Turrets, and Guns. When the server gets "Hull" request it returns all needed information ...
4
votes
0answers
489 views

Update UI once all API calls are done

I'm learning Swift at the moment but I would like to produce well-organised code. The goal of my little app is to display the weather of my current location. I use : the API of Darksky : https://...
2
votes
2answers
203 views

Laravel lumen : Post API method

Question is quite simple, I am using dingo package, Currently below is my code for an API call. ...
2
votes
2answers
186 views

API with revealing module pattern in Javascript

I'm working on a project where I want to create a API that can be used to do some mathmatical calculations. Here are the important aspects: I used the revealing module pattern I added method ...
4
votes
1answer
88 views

API , client program and daemon to read and set screen brightness

I wrote an API including a CLI program and a daemon to set the brightness of a display under Linux. The API is mainly represented by the class Backlight() and is ...
10
votes
1answer
6k views

Simple yet Hackable WhatsApp API [UNOFFICIAL]

There is no official WhatsApp API. Here is a simple python class which satisfies the need. ...
1
vote
0answers
35 views

Return two results from API with an ID set

I am calling from an API to return a member and their upcoming classes. I would like to show only the next two classes (up to six are available in the API) that have an ID set. ...
2
votes
1answer
275 views

Beginner Node.js app using Heroku w/ Mailchimp API

I'd like some feedback on the readability and style of the following code. It's a simple Node.js app that uses the Mailchimp API to add emails to a list. The client side handles SVGs, sign-up ...
4
votes
1answer
508 views

Python API for simple OpenCV image proc, called with JSON inputs

Background I've got OpenCV & Python installed on a Docker container which is on a http server to process images and serve them. The user interface is through the web; user inputs an image and ...
2
votes
2answers
2k views

Java API token expiration handler

I want to implement a utility class which manages tokens generated by any API. The idea is simple: It should store the current token value. The token should be initialized just before first use ...
1
vote
1answer
76 views

Aggregating clients and client types

The code I have put together achieves what I want, but I don't know if it is the right way to go about tackling the problem. I am dealing with 2 tables (CLIENT, CLIENTTYPE) each of which I have an ...
6
votes
1answer
309 views

Python API for Crimson Hexagon

I'd like some feedback on the readability, style, and potential problems or issues. In particular I'm not too happy with how I handle ratelimits. ...
2
votes
1answer
63 views

Small module for getting JSON to work with in Python

I currently have a module with Class / Methods I want to use in other scripts. Recently chess.com released a read-only REST API for beta-testing. The methods in my class build a URL for the API ...
3
votes
1answer
102 views

API Implementation and Architecture

I recently put together an Express/Node API that consumes and transforms an additional third party API. And while everything is working great, I feel there may be ways to improve the architecture ...
1
vote
0answers
48 views

Android continually run api request

What is the best practice to run continually api request, like every 1-10 seconds. Currently I am doing this which is not a good practice I think, it probably causes some overhead: ...
3
votes
1answer
837 views

Bulk Email notifications in Java?

I have written a service which uses the Java Mail Api to send bulk email notifications to the recipients. I feel that the way I implemented the solution is not really scalable when the number of ...
1
vote
1answer
181 views

Fetching and shortening URLs with API calls using Promises

I have a node module that accesses the News API to fetch news articles and runs each article's URL through Google's URL shortener. It also has a caching mechanism implemented. This was previously ...
1
vote
0answers
37 views

API separate request vs logic

Is it a good practice to separate Logic from Request controller in an Api ? Without separation: ...
0
votes
1answer
441 views

C# API Wrapper with Static Function Calls

I'm creating a wrapper library for an API, and I hit a block on how to redesign it. The entire library is static, and I'd like to change it to make it more testable. The library's goal is to make ...
3
votes
2answers
529 views

Implementing unified API data flow in ASP.NET Core

I have the API project on ASP.NET Core, and it's quite annoying always write methods like this: ...