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
3
votes
2answers
138 views

Access a database and an API, uses python generators, and matches the results based on names, interview assignment

Thanks in advance if you are reading this code. I recently submitted this code as part of an interview (took about 4-5 hours). Unfortunately, they did not like the code and I received a form ...
3
votes
1answer
35 views

Get data from pipedrive API and insert it into Snowflake

I am a new python programmer. I have created the code to put API data from pipedrive to Snowflake database. Here are the steps in my code. Delete the csv file if it exists. Make an API call put all ...
2
votes
0answers
33 views

Pokedex that displays flip cards

https://jsfiddle.net/0a7tcv2g/ I know I could locally store the data, write in es6, and all that, but I wanted to learn to work with APIs, and really understand JS through ES5, before brushing up my ...
2
votes
0answers
55 views

High-Level Managed Observers

I was thinking of adding a very high-level implementation of the event/observer pattern to my project. The implementation would manage adding and removing observers as "needed". You can use an almost ...
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 ...
3
votes
0answers
32 views

Searching all new Reddit comments for comments matching regular expressions and notify of matches

This program constantly sends an https request to Reddit's API for new comments. Using a PostgreSQL Database containing Regular Expressions, find comments of interest and notify about them using faye....
4
votes
1answer
115 views

Recursive function to get all Zendesk tickets

I'm developing a Python library to consume the Zendesk search API. Problem is, Zendesk limits search results to 1000 items. Thus in order to get all the results if they are greater than 1000 I need to ...
7
votes
2answers
120 views

C++ wrapper for graphviz library

Background The code below is (obviously minimally) ripped out of a current live project. The project does reasonably sized data extraction, cleaning, analysis, clustering and visualisation (on a ...
4
votes
1answer
392 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 ...
4
votes
1answer
82 views

Fetch API wrapper

I have created a wrapper for Fetch to send requests to my API. The module exports api, and requests can be made with: ...
1
vote
1answer
42 views
4
votes
1answer
61 views

Citymapper API wrapper

As a simple project to tackle during the holidays I've set to write a simple wrapper around Citymapper's api to familiarise with httr, ...
12
votes
1answer
309 views

Tick. Tick. *breathe* BOOM! - Setting up real, stable asynchronous callbacks with WinAPI Timers in VBA

WinAPI Timers can be quite tricky to work with, as anyone who's tried to use them and fallen foul of one of the many pitfalls probably knows. Problems such as screen freezing, crashes, uncontrolled ...
2
votes
1answer
36 views

Express Rest API Async and Scaling

I am currently learning how to create nodejs express rest api using async making it fully scaleable and secure. My goal is to ensure maximum functionality and speed, currently I am using MVC ...
1
vote
0answers
25 views

Splitting environments: prod and dev modes

I've decided on splitting my environments keeping them in .js files in an environment folder and keep all the sensitive information in .env file (use a third-party module 'DOTENV'). That's what I've ...
3
votes
0answers
42 views

Reduce cluttering in a VPN initialization dance implementation (html, xml extraction and api calls) in Go

I'm still rather new to Go and I wanted to convert a part of a Python script I wrote a while ago to perform the VPN initialization dance (basically a set of API calls + parsing to fetch an auth cookie ...
4
votes
0answers
170 views

nodejs 401 request retry mechanism

I'm working on a project in which I have a backend in nodejs and from there I need to call external APIs, those APIs require authentication token which is valid for 15 minutes. So if response status ...
5
votes
2answers
3k views

Rails validating API parameters

I wanted to keep my API request logic separate form the controller logic. I therefore make use of a separate model (EmailChecker) that creates an instance of this ...
3
votes
0answers
73 views

Wrapping a C API to be implemented in rust

I'm writing a Rust library to facilitate implementing the following C API in Rust. That is, it should be possible to create a Rust-idiomatic implementation by depending on my wrapper library. ...
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 ...
5
votes
1answer
1k views

Rails & RSpec - Testing API with request specs and shared examples

I have written the following shared examples which are used in multiple request specs to test a namespaced RESTful JSON API. Application details: Rails 4.2, RSpec 3.5, Devise for authentication and ...
3
votes
0answers
109 views

Middleware which lets developer maintain dynamic context

Problem Statement: Users can chat while the replies of the chatbot are based on past messages. So the chatbot needs to have the context of the previous messages and reply accordingly. Here is ...
6
votes
1answer
1k views

Django Rest Framework Totaling API values in different ways

I am working on a stats website for my softball teams that I manage/play for. Here is my current Stat model: ...
4
votes
1answer
57 views

Paginating API with “next” Pythonically

I'm wondering if there's a more Pythonic way to keep paginating an API endpoint until there's no next key in the response. The thing that bothers me the most is the ...
2
votes
0answers
58 views

GraphQL Schema for a Social Network [closed]

I am learning about GraphQL so I decided to make a schema for some sort of social network. Please let me know if there are any best practices I should follow based on my schema below. ...
2
votes
1answer
41 views

WP/PHP getting API data and using hook

Below are the two things I'm trying to solve, logically. This is just a proof of concept; and I'm not implementing this on real data nor via full plugin at this time. Just looking at logic and syntax ...
1
vote
1answer
111 views

Laravel show and update currency from rest api

I need: Daily save new exchange rates from the REST API in the database. Return the current exchange rate for a given currency, the whole table for a given day, the exchange rate for a given currency ...
1
vote
1answer
37 views

Display name and email fetched using JSON API when hovering

I'm learning AJAX JSON. I'm just testing how to pull the data. The idea is, when hovering over the number, it pulls the data and show the content for name and email. Number 1 is to show name and ...
2
votes
1answer
46 views

Validate (Possible) File/Directory Path

I am working on a "comprehensive" library for use in my internal applications and I have created a working method (as far as all of my testing has shown thus far) to ensure that a file/directory path ...
3
votes
2answers
108 views

Fetching counties and localities using JSON API calls

I'm using the below code to call different methods from an API: ...
5
votes
1answer
136 views

GMAIL API -Create/Send/Search messages for keyword

I have written below code using GMAIL API reference which creates a basic message, sends it and also lists all the messages from user's mailbox matching a keyword.It works fine. Looking for experts ...
7
votes
2answers
91 views

Java command-line API client to fetch Bitcoin exchange rates

I am building a simple Java command-line application. And I want to know the best practice and make my code clean. Can anybody suggest to me how many different classes I can make and what more method ...
3
votes
0answers
73 views

Driver program using custom 3D game engine [closed]

I am working on a custom game engine and have been fleshing out the various submodules (meshes, physics, shading, etc.) Here is a sandbox program that exercises the newly finished camera system. ...
1
vote
0answers
78 views

Generics and aggregated evaluation of validation rules

I have a custom system for data validation; it handles anything from method parameters, return values, objects, etc. The core of this system is IValidationRule and ...
4
votes
1answer
123 views

Chuck Norris Joke Teller

I've created a command line joke teller which makes Chuck Norris jokes after communicating with the Chuck Norris API. It also allows you to generate a random person by communicating to the names API ...
8
votes
1answer
159 views

Normalize whitespace and describe string

The most valuable of all talents is that of never using two words when one will do. Thomas Jefferson. NuGet and GitHub I found it useful to automatically normalize string content a little bit and ...
2
votes
1answer
86 views

controller design of a REST API in PHP

I'm building an example REST API in PHP in my local environment to learn how they work. The starting point was an online tutorial. The example is working fine; however, I have a hunch that there is ...
2
votes
0answers
30 views

Library/API: simple springboot / jdbc query builder and ORM

I have been using and developing a simple ORM and query builder library that I have found useful in it's practical application. I am pretty sure there are improvements to be made, and I welcome any ...
9
votes
1answer
46 views

Mixed-width operations for std::bitset

When I was looking to use std::bitset instead of GCC's __uint128 in my RDS error-corrector, I found that it was hard to use, ...
3
votes
0answers
53 views

Node Based Code Flow Builder

Background In my development of a game engine, I realized the need to be able to construct processing units in a serializable way (code below does not show serialization, just the wiring). I broke ...
4
votes
2answers
513 views

Python wrapper for the Help Scout API

I started porting an API wrapper from Java to Python for practice. I am looking for ways to improve the readability/maintainability this code. I have done some reading about "pythonic" style and I am ...
4
votes
1answer
68 views

Immutable Keyed Set

Description An immutable keyed set is a readonly collection of elements without duplicates or null values having each of the elements linked to exactly one key. Example This simple example ...
4
votes
2answers
456 views

Pulling financial data via IEX Cloud API

I am pulling some financial data from the IEX Cloud API. Since it is a paid API w/ rate limits, I would like to do this as efficiently as possible (i.e., as few calls as possible). Given that the <...
2
votes
3answers
115 views

Reading, cleaning and parsing CSV

This project was completed as part of an interview challenge. The feedback I received was: The code is neither optimized nor does it follow generally accepted paradigms, naming conventions or best ...
6
votes
2answers
144 views

Safe and simple strtol()

Until today, in the few cases where I needed something like this, it had been in simple programs which only I used, and where I didn't care about security, so I used the simple ...
6
votes
1answer
99 views

Generate music notes by specified key and scale

As a follow-up on isosceles' question, I have created a small API to generate the notes of a scale given the pitch class set and key note. I've added the reinventhing-the-wheel tag because I know ...
0
votes
0answers
407 views

Gmail API list messages NodeJS

I use the following code to list and trash messages from the Gmail API in NodeJS. I call the getAllMessages method to get all email bodies because the Gmail API ...
4
votes
1answer
109 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'...
4
votes
2answers
221 views

PHP script that writes a JSON file with iextrading API data

iextrading has two APIs (v1, v2) which provide financial market data. Following script records a JSON file with their equity information (using a CRON job). Would you be kind and review it for any ...
1
vote
1answer
80 views

Simple CRUD back-end for an inventory-tracking web API

This is the simple back-end, albeit crude, that I made for a React Native mobile app project as a proof of concept. It's a basic CRUD for tracking supply inventory. The "shopping list" is items with a ...

1 2 3 4 5 9