Pages:
Author

Topic: We are working on an API for Bitcoin! - page 2. (Read 741 times)

jr. member
Activity: 32
Merit: 41
April 26, 2023, 09:40:46 AM
#34
When you say specify fields, you mean the returned data should be what you exactly need?(based on the specified fields), in this case, it is doable but not that common, if I misunderstood your question, please clarify.
Fields parameter is only applicable for "get all" type of API endpoints. In my opinion, it makes API more flexible, particularly it becomes easier for developers to massage the fetched data, save processing power and internet traffic. Currently, you have many endpoints to retrieve different information about a single bitcoin address (like details, UTXO, history, balance, etc). You could also add another endpoint that retrieves the information about all the funded addresses in the blockchain. Without fields specified, a response may contain full information about each address. But with fields, the following will occur:

Request:
Code:
curl `https://btc.merapi.io/addresses?fields=balance`

Response:
Code:
[
{
    "address": "bc1qd073gqts3cmquwqh9cha39y5lrvuffjfp5zef9",
    "scripthash": "86d0f61cd7154038ef031e4b91abdb04fd9835b02c8bb39706d34945a949d040",
    "confirmed": 36453,
    "unconfirmed": 1000,
    "summary": 37453,
    "count": 34,
},
{
...
}

]


BTW , if you don't mind me asking, do you have any specific use case for it?
Not yet, but look at the link under my avatar: it a simple web application for signing and verification of bitcoin messages with backend written in Python. In the future, I am planning to rewrite it in Javascript or something and add some other interesting features besides message manipulations. Your API may come in handy.


I see! We are going to consider adding the 'fields' parameter in the future but note that internet traffic is not that high since we are using Gzip to compress responses.


Also, we are going to add the search for address by first characters in the next couple of weeks. Going to update you regarding this.
And please keep in touch if you have any questions,  other suggestions or feedback.
legendary
Activity: 2450
Merit: 4414
🔐BitcoinMessage.Tools🔑
April 26, 2023, 08:10:21 AM
#33
When you say specify fields, you mean the returned data should be what you exactly need?(based on the specified fields), in this case, it is doable but not that common, if I misunderstood your question, please clarify.
Fields parameter is only applicable for "get all" type of API endpoints. In my opinion, it makes API more flexible, particularly it becomes easier for developers to massage the fetched data, save processing power and internet traffic. Currently, you have many endpoints to retrieve different information about a single bitcoin address (like details, UTXO, history, balance, etc). You could also add another endpoint that retrieves the information about all the funded addresses in the blockchain. Without fields specified, a response may contain full information about each address. But with fields, the following will occur:

Request:
Code:
curl `https://btc.merapi.io/addresses?fields=balance`

Response:
Code:
[
{
    "address": "bc1qd073gqts3cmquwqh9cha39y5lrvuffjfp5zef9",
    "scripthash": "86d0f61cd7154038ef031e4b91abdb04fd9835b02c8bb39706d34945a949d040",
    "confirmed": 36453,
    "unconfirmed": 1000,
    "summary": 37453,
    "count": 34,
},
{
...
}

]


BTW , if you don't mind me asking, do you have any specific use case for it?
Not yet, but look at the link under my avatar: it a simple web application for signing and verification of bitcoin messages with backend written in Python. In the future, I am planning to rewrite it in Javascript or something and add some other interesting features besides message manipulations. Your API may come in handy.
jr. member
Activity: 32
Merit: 41
April 25, 2023, 03:56:40 AM
#32
My question is about the design of your API, particularly I am interested in why you have decided to use POST methods for some operations, for example:

1. Get UTXO of multiple addresses
2. Get balance of multiple addresses
3. Get history of addresses
4. Get transactions by IDs

Can't this information be obtained via simple GET request that doesn't imply modification of server data? For example, the list of addresses or transaction IDs could be included in a request URL directly as a query string. Or is it done for privacy purposes to prevent others to intercept potentially sensitive information? Sorry, if my question doesn't make sense, I am still new in API development.

The ideal situation is to use get method(as you see in most of the endpoints), but sometimes the data is too big(bigger than 2048 characters which is the Get limit), that is why for the methods that possibly require more than the Get limit size, we used Post method.

Would you mind adding some additional functionality to make the life of developers and regular user even easier? For example, I would like to have an option to specify fields when making a GET request, search addresses by first characters, sort them by balance or filter them by specific condition.

When you say specify fields, you mean the returned data should be what you exactly need?(based on the specified fields), in this case, it is doable but not that common, if I misunderstood your question, please clarify.
And regarding the search feature, this is interesting and of course doable, and makes sense if we remove addresses with zero balance periodically(otherwise it would be a too big dataset), the thing is it adds extra costs to our infrastructure, so let me see if it is possible to do it for now or we should postpone it to the future where we have some funds. BTW , if you don't mind me asking, do you have any specific use case for it?

legendary
Activity: 2450
Merit: 4414
🔐BitcoinMessage.Tools🔑
April 25, 2023, 02:54:27 AM
#31
My question is about the design of your API, particularly I am interested in why you have decided to use POST methods for some operations, for example:

1. Get UTXO of multiple addresses
2. Get balance of multiple addresses
3. Get history of addresses
4. Get transactions by IDs

Can't this information be obtained via simple GET request that doesn't imply modification of server data? For example, the list of addresses or transaction IDs could be included in a request URL directly as a query string. Or is it done for privacy purposes to prevent others to intercept potentially sensitive information? Sorry, if my question doesn't make sense, I am still new in API development.

Would you mind adding some additional functionality to make the life of developers and regular user even easier? For example, I would like to have an option to specify fields when making a GET request, search addresses by first characters, sort them by balance or filter them by specific condition.
jr. member
Activity: 32
Merit: 41
April 24, 2023, 12:31:21 PM
#30
I am really sorry for that, yes it is down. The server has crashed down for some reasons and the support team is not responding to my tickets. I will let you know when it is back online.
P.S
It is my first priority to find a better server so we don't face such issues in future.

What are you currently using? Have you considered using AWS API Gateway? There's a free tier available, so that's 1 million API calls received free (per month) for the first year.

we are using a server from a datacenter (not AWS, too expensive for us ATM), the ideal situation is to use a set of servers to handle data loss and service outage.

the service is up BTW
staff
Activity: 3500
Merit: 6152
April 22, 2023, 10:24:58 AM
#29
I am really sorry for that, yes it is down. The server has crashed down for some reasons and the support team is not responding to my tickets. I will let you know when it is back online.
P.S
It is my first priority to find a better server so we don't face such issues in future.

What are you currently using? Have you considered using AWS API Gateway? There's a free tier available, so that's 1 million API calls received free (per month) for the first year.
jr. member
Activity: 32
Merit: 41
April 22, 2023, 10:16:22 AM
#28
Is the API down at the moment? I'm trying to use Socket to watch an address and I keep getting a timeout error. I'm basically doing the exact same as you are doing in the documentation, just in Python instead:

Code:
import socketio

sio = socketio.Client()
sio.connect('https://btc.merapi.io/global')

@sio.on('spent-address-X_ADDRESS')
def on_spent_address(data):
    print(data)

sio.wait()



I am really sorry for that, yes it is down. The server has crashed down for some reasons and the support team is not responding to my tickets. I will let you know when it is back online.
P.S
It is my first priority to find a better server so we don't face such issues in future.
staff
Activity: 3500
Merit: 6152
April 22, 2023, 10:04:23 AM
#27
Is the API down at the moment? I'm trying to use Socket to watch an address and I keep getting a timeout error. I'm basically doing the exact same as you are doing in the documentation, just in Python instead:

Code:
import socketio

sio = socketio.Client()
sio.connect('https://btc.merapi.io/global')

@sio.on('spent-address-X_ADDRESS')
def on_spent_address(data):
    print(data)

sio.wait()

jr. member
Activity: 32
Merit: 41
April 19, 2023, 01:32:33 AM
#26
https://btc.merapi.io/swagger doesn't work. Web server is down Cloudflare 521.

Sorry for that, it was a server failure! trying to migrate to a better servers soon.
full member
Activity: 868
Merit: 190
web developer for hire
April 18, 2023, 12:06:48 PM
#25
https://btc.merapi.io/swagger doesn't work. Web server is down Cloudflare 521.
jr. member
Activity: 32
Merit: 41
April 16, 2023, 10:04:53 AM
#24
Hello. I run this website  where I get some blockdata from mempool.space

This tool below shows the balance of multiple addresses.
I am struggling to find an api which would allow to check dozens or hundreds of addresses

https://bitcoindata.science/bitcoin-balance-check.html

However,  this is just a hobby and I have no money to support your project

But maybe some partnership could benefit us both.

Take a look if I can use your api.

I had 6k unique visitors last month

added this:
https://btc-docs.merapi.io/#get-balance-of-multiple-addresses-seperately

Please check this out, and let me know what you think.


P.S
Please send an email to me so we can catch up.
jr. member
Activity: 32
Merit: 41
April 16, 2023, 08:29:46 AM
#23
I understand that the API is currently free, but I would imagine there are still some limits on how many requests one can make per second or minute?



No limit ATM, But eventually we are going to do that. note that we are running the service on a not-very-powerful server, soon we plan to migrate that to a much better set of servers.

Also, regarding this: https://btc-docs.merapi.io/#lock-on-address

It says "incoming" transactions. Do you have something similar for outgoing transactions?



Yes, try https://btc-docs.merapi.io/#spent-to-address
and I am going to make some changes to the documentation, it has many typos which don't look good(Sorry for that!)

Update:
I made some changes to the docs and some links were changed.
so, these two are the new ones:
https://btc-docs.merapi.io/#lock-to-address
https://btc-docs.merapi.io/#spent-from-address
staff
Activity: 3500
Merit: 6152
April 16, 2023, 06:02:55 AM
#22
I understand that the API is currently free, but I would imagine there are still some limits on how many requests one can make per second or minute?

Also, regarding this: https://btc-docs.merapi.io/#lock-on-address

It says "incoming" transactions. Do you have something similar for outgoing transactions?

jr. member
Activity: 32
Merit: 41
April 14, 2023, 01:21:26 PM
#21
Hello. I run this website  where I get some blockdata from mempool.space

This tool below shows the balance of multiple addresses.
I am struggling to find an api which would allow to check dozens or hundreds of addresses

https://bitcoindata.science/bitcoin-balance-check.html

However,  this is just a hobby and I have no money to support your project

But maybe some partnership could benefit us both.

Take a look if I can use your api.

I had 6k unique visitors last month

Right now we return the total balance for multi addresses. Let me see what we can do. I try to implement it in the next couple of days. Then we can talk about a possible partnership.
member
Activity: 182
Merit: 35
STRAIGHT FORWARD
April 12, 2023, 05:44:15 PM
#20
Hello. I run this website  where I get some blockdata from mempool.space

This tool below shows the balance of multiple addresses.
I am struggling to find an api which would allow to check dozens or hundreds of addresses

https://bitcoindata.science/bitcoin-balance-check.html

However,  this is just a hobby and I have no money to support your project

But maybe some partnership could benefit us both.

Take a look if I can use your api.

I had 6k unique visitors last month

it will be more unique if you can generate a link with your addresses list so you don't enter them manually every time but just open the url and it will show those addresses balances every time

GET BALANCE - GET BALANCE & GENERATE URL
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
April 12, 2023, 05:32:51 PM
#19
Hello. I run this website  where I get some blockdata from mempool.space

This tool below shows the balance of multiple addresses.
I am struggling to find an api which would allow to check dozens or hundreds of addresses

https://bitcoindata.science/bitcoin-balance-check.html

However,  this is just a hobby and I have no money to support your project

But maybe some partnership could benefit us both.

Take a look if I can use your api.

I had 6k unique visitors last month
jr. member
Activity: 32
Merit: 41
April 12, 2023, 01:58:53 PM
#18
So basically this is a REST API isn't it ?!

It uses HTTPS as communication protocol, request/get/post etc to request stuff... and JSON as feedback/response.

So this is REST ?! Wink

Would be a little simpler to mention that in the introduction ! Wink

Oh, by the way, I like this idea/API a lot !

WELL DONE !

But will it keep up and running ?!

Why you provide this functionality for free ? What is the catch ? Wink

Maybe thrive on donations ? Or advertisement ? Spying ?

Thanks for checking it out! This is basically a service that you can use by calling it or subscribing to topics by sockets!

We are not going to keep it running for free for sure! We are trying to get People's opinions on this first! When others see value in the project and want to use it, that is when you we start monetizing it(like many other projects), and donations are always appreciated(and actually common in Bitcoin community). And Nah, we are not into spying! not our thing Smiley
full member
Activity: 385
Merit: 110
April 11, 2023, 08:00:46 PM
#17
So basically this is a REST API isn't it ?!

It uses HTTPS as communication protocol, request/get/post etc to request stuff... and JSON as feedback/response.

So this is REST ?! Wink

Would be a little simpler to mention that in the introduction ! Wink

Oh, by the way, I like this idea/API a lot !

WELL DONE !

But will it keep up and running ?!

Why you provide this functionality for free ? What is the catch ? Wink

Maybe thrive on donations ? Or advertisement ? Spying ?
legendary
Activity: 3500
Merit: 6320
Crypto Swap Exchange
April 11, 2023, 07:12:54 AM
#16
From tl;dr (and could not find it anywhere) what info are you logging and keeping?
Most of us here have privacy a bit more in our minds then a lot of other people / users.

From the tests I did it looks nice, but if you are going to logging and keeping and trying to monetize everything thing I do you are going to have trouble getting users.
If you purge all data after 24 hours, just so you do have some logging if support is needed is a different story.

-Dave
jr. member
Activity: 32
Merit: 41
March 17, 2023, 11:03:39 AM
#15
First thing for an online service is a front end complete website.
Who said that? If you're smart enough you'd know you can access the API endpoints and figure out the rest. And there is an API documentation: https://btc.merapi.io/swagger what else do you need?

I agree, I would just redirect merapi.io to
https://btc-docs.merapi.io/#introduction tbh.
I haven't poked around just yet but on the top this looks nice.

First thing for an online service is a front end complete website.
Who said that? If you're smart enough you'd know you can access the API endpoints and figure out the rest. And there is an API documentation: https://btc.merapi.io/swagger what else do you need?


Looking forward to hearing your feedback if you both got some time, and please share it with others if possible, we are trying to get a sense how the community reacts to the project and how we can make it better.

Pages:
Jump to: