Coinbase API: Get spot prices for multiple assets - coinbase-api

This question is very similar to another which received no answer. Using the Coinbase public API, it's possible to get the spot price of an asset via this endpoint.
GET https://api.coinbase.com/v2/prices/BCH-USD/spot
If I'm building an application that needs to watch the spot prices of 10 different markets, am I supposed to make 10 calls? Is there a way to submit the list of markets I want the spot price for?
As a backup, as the linked question above asks, is there a way to get all supported spot prices in one call so I can filter out what I want? It's still really inefficient, but probably not as bad as making 10 calls.

Related

How to get historical floor price data for an NFT collection?

I am trying to get some dataset for my university project. I checked the documentation for OpenSea API but was not able to find if we can fetch historic data for a collection. I want to get avg. floor price for some of the collections of each month since its launch. Can anyone tell me if we can even do it using OpenSea API or suggest any other APIs?
You can't get the historical floor on Opensea's API. There are other available api's that give historical floor such as NFTGo. Also at Flips.Finance, we (disclaimer: I'm a co-founder) provide charts and analysis on the historical floors. Let me know if you have other questions

How do you technically save how many people have visited a certain URL or a certain post?

I am trying to create a forum app using Django as a backend and React as a front end. I want to find out how many people have visited a post created by a user so that I can store as views and list the posts according to popularity.
I am just a student and I have no experience with live websites, so I'm wondering if it is okay to just save a user at componentdidmount life cycle? But I'm afraid it'd make the same user be counted as many as he visits and the post creator will be able to increase his post's popularity by just spamming his website.
I would suggest you implement this on the backend, not the front end. I don't know Django well, but there should be some way to know whether that particular post is getting requested. At that point, you'll want to increment the counter for that post.
The problem of course is determining which "views" count as real views. Was it the poster? Was it a robot? Was it a spider? Was it a scraper? Was it the same person who is not the poster viewing it many times?
I wouldn't say this last part is not an easy thing to implement, and would probably take some trial and error before finding the right conditions to get your metrics "right".
As #Mike suggests above, there are many analytics packages which use sophisticated algorithms to determine "realness", and you may be able to use this data. My understanding is that you want to actually apply the data to sorting and UI for your app, not just view it on the dashboard of your analytics tool. I've never tried to look for one that supports an API to discover what you're interested in programmatically, but they all probably allow you do download structured data about your traffic. The problem with the latter approach is that creates a delay and a manual step (always something to try to avoid imo).

Building personalized feed on App Engine

I have been working on a social app. I'll first explain the problems, and then summarize in the questions below.
In the network, there would be channels, and users. Users can subscribe to these channels, and to other users. This way, we have two sources from which posts can be generated.
Now, we can simply keep one Activity model where we record all the actions, their kind, and what they affect. Be it from channels, or from the users. And refer these while creating a feed for each user.
I found a solution given in a talk by Brett Slatkin which basically suggests using ListProperty to link each post with each subscriber. But Guido suggests not to use lists if there's going to be more than 1000 elements. So if there's going to be more than 1000 subscribers to a channel, this will probably run into problem. Even if this were to work --
I want to rank the posts based on popularity (based on number of votes, comments), and apply some time decay function. More like Reddit. To do so, I will have to keep the Activity in memory, and filter and order it based on ranks for each user. I'll also need to do it periodically since new activities will keep occurring also old activities will gain, or lose their values.
The challenge is -- To keep the data in memory (for processing the feed as well as to keep things fast). I will have to store a copy of each users feed to persistent storage, but if the order of posts is going to be changing, how do I keep track of that in the database?
Also: I have kept my options open -- I will move to AWS if I have to.
To summarize:
Is there a better solution to keep track of subscribers without using Lists? Using something like PostID > SubscriberID in one entity would be very, very expensive and inefficient.
If there's any cost-effective and fast solution to the problem above, how do I deal with the next challenge -- which is to generate a personalized feed? (memory issues - unknown size of memcache)
If I can generate a personalized feed (which will be dynamic, will be changing) how to I keep it in the database?.
I have gone through several articles and I can probably solve first two problems with AWS, but I am trying to stay away from the manual scaling work. If there is no way, I am willing to move to AWS. Even if I move to AWS, I can't think of a solution to the third problem.
Any thoughts, directions, resources would be helpful! Thanks!

Shopify - data model

One of my customer requested some changes on shopify site. She sell pictures and she would like to start offer the frames.
But the whole administration of the frames will be so complicated that I know now, that I will need to somehow extend the data model, because I will need to store some additional relations.
So my question is: Is it somehow possible to store any kind of data by shopify API? Like create a new entities with custom attributes etc. I was searching through the API documentation but I was not able to find any solution.
Second question is: Would it be possible to solve this problem by Embedded App? Thats mean, that I will develop the whole administration part as a small application and then embed it to the shopify? Will it be possible then join data from shopify storage and my database through Shopify API?
Is there some example for this scenario?
Thanks you for your help.
I built a Shopify store selling frames when Shopify first came out. That shop still sells many many frames. There was not even a Shopify API back then. Still, it was possible to do it with 100% client-side code. You simply price each frame in units. For example, $1 per inch. Client-side you collect the frame size as length x width, and come up with the total inches needed, and there is your quantity. Use mm, cm whatever units work for you. You can even get fancy if you're good, and work in mats, backing, and types of glass, all with one add to cart click.

Store location information, or use a third party source?

I'm working on a location-based web app (learning purposes), where users will rate local businesses. I then want users to be able to see local businesses, based on where they live and a given range (i.e., businesses within 10 miles of 123 Street. City St, 12345).
I'm wondering what I should use for location info; some 3rd party source (like Googles geocoding API) or host my own location database? I know of zip-code databases that come with lat/lon of each zip code along with other data, but these databases are often not complete, and definitely not global.
I know that most API's set usage limits, which may be a deciding factor. I suppose what I could do is store all data retrieved from Google into a database of my own, so that I never make the same query twice.
What do you guys suggest? I've tried looking at existing answers on SO, but nothing helped.
EDIT To be clear, I need a way to find all businesses that fall within a certain range of a given location. Is there a service that I could use to do this (i.e., return all cities, zips, etc. that fall within range of a given location)
Storing the data you retrieve in a local cache is always a good idea. It will reduce lag and keep from taxing whatever API you are using. It can also help keep you under usage limits as you stated. You can always place size limits on that cache and clear it out as it ages if the need arises.
Using an API means that you'll only be pulling data for sites you need information on, versus buying a bunch of data and having to load/host it all yourself (these can tend to get huge). I suggest using and API+caching

Resources