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
1
vote
1answer
93 views

Wrapper for a sales API, with a fluent interface

I've created a simple API wrapper that I intend a few developers to utilize. I decided to follow an Fluent Interface methodology, similar to this. ...
0
votes
1answer
91 views

Nodejs Interview - API calls and exchange rate

I did an initial technical phone screening with this company which went ok, they then sent me a programming exercise to complete and send back to them. The goal of the exercise: -take input as a ...
3
votes
1answer
87 views

Java Concurrent Recursive API Access

I don't get to write multithreaded applications very often, so be gentle with my threads :-) I have an API input which contains a "score" and then a bunch of child nodes which also have scores, and ...
3
votes
1answer
113 views

Java Messenger data transmission

This is a very simple concern, could somebody take a look at a few lines of my code? I'm writing a simple Java multi-user messenger, it is structured in a desktop client with a Swing GUI, a java ...
2
votes
1answer
5k views

Async await multiple API calls

I have an application that needs to contact a remote API many times to request information about various products. It was taking around a minute with synchronous programming. I adjusted all my methods ...
6
votes
1answer
76 views

Filter by multiple options - also only if not empty [closed]

Here's how my json looks like. I'm trying to write a function which filters based on participantCriteria.criteriaType & participantCriteria._id ...
0
votes
1answer
2k views

Toy Robot coding puzzle with Java

The following code is my solution to a code challenge I submitted a few days ago. I got rejected straight away with no feedback and I've wondered why. Here is the full code repo. Requirements ...
3
votes
0answers
84 views

Implementing secure API for use between other internal apps

My team and I are trying to implement a secure API and would appreciate some feedback on the following: If there are areas of improvement in the current code to improve security Recommendations on ...
3
votes
0answers
103 views

Retrieving data from the movie database

I am trying to retrieve the series, seasons and episodes from the movie database, however I am pretty new to Ruby on rails and I feel like what I am doing could be improved a lot. I use an ...
2
votes
3answers
219 views

Display search results for TV shows

I haven't been coding super long in this language so if someone could take a look and help me improve my code and make it more efficient, that would be great! The HTML is one input field that you can ...
1
vote
2answers
288 views

Retrieve data from eBird API and create multi-level hierarchy of locations

As you may know, I like birds. The Cornell Lab of Ornithology has a tool called eBird where you can submit records of the birds you identified. I recently learned they have an API that I can query, ...
3
votes
1answer
231 views

Enforce request completion order using Multiple Promise Chaining

The main entry point is the SyncmyCompany() function. I have a interesting scenario where I'm syncing data from a Company to a destination system. In this case ...
9
votes
1answer
1k views

Simple cryptocurrency portfolio rebalancer

EDIT: the code has been changed significantly since the OP based on the first posted answer and some refactoring. Feedback on the general design of the app itself is still more than welcome. The ...
5
votes
2answers
1k views

Apple receipt validator

I'm working on a solution for validating Apple receipts. Here's the repository as whole. I based it mostly on the gdx-pay-server library. In my implementation, one of the classes I want to improve is <...
4
votes
1answer
422 views

Executing a sequence of actions over time in Unity

This script executes a sequence of actions over time and is based on the methods exposed by the UrhoSharp framework. I am new to Unity, but well acquainted with C# so I know what I'm doing for the ...
3
votes
3answers
70 views

REST API for random number generation using Falcon

I have written REST API for random number generation using Falcon(https://falconframework.org/), just for my learning process. This is API: ...
5
votes
1answer
204 views

Wikipedia Random Page in Category Bot

I recently wrote a Python script to generate a random page within a Wikipedia category and its subcategories: ...
4
votes
1answer
66 views

Code improvements for React App

This was my code challenge for a Junior JavaScript Developer position. The app is mostly running error-free, but I was rejected for the role, so I assume there were major issues with my code and have ...
1
vote
1answer
106 views

Kotlin API - endpoint for users

I am writing API in Kotlin - this is my first code in this language. I implemented a very primitive 'player' endpoint. I was wondering if I am doing everything ok (please don't mind the static ...
2
votes
0answers
202 views

Setting many properties in a PHP class

I'm trying to define parameters for my API. It's a super basic one and the first I've made. I'm trying to instantiate my class and set parameters but to me it seems super messy. Is this really the ...
1
vote
3answers
107 views

Calculate cryptocurrency gains and losses using the Coinbase API

This class calculates the gains and losses (in USD) from the four leading cryptocurrencies using the Coinbase API. (The full repo can be found here) In addition to general feedback there are some ...
3
votes
1answer
268 views

Code to call Space X API and display results

This is a technical test from a job interview. The feedback was that although it does as asked, the application structure wasn't great. As a beginner I'm not entirely sure what's wrong with it and ...
3
votes
1answer
98 views

API Gateway for blocking api calls

I recently had a programming interview, where I had to create an Api Gateway. The description is as follows: You need to create a gateway in which it only allows certain number of callers to call ...
0
votes
0answers
58 views

Looking for react API call and es6 map() evaluation

The react application is showing API fetch result in the page based on query string tag selected. There are few question in ...
3
votes
2answers
181 views

Haskell API for accessing a SQLite database

I have a SQLite database, and I'm trying to make a web API for it. I've been writing it in Haskell, and using scotty as the server. I templated out the website from ...
2
votes
0answers
79 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
69 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
152 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
40 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
78 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
146 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
817 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
96 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
2k 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 ...
8
votes
3answers
594 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
111 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
1k 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
78 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
176 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
238 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
196 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
142 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
61 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
80 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
33 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
1k 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
947 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 ...

1 2
3
4 5
10