Skip to content

Transactions By Date #46

@Horlabrainmoore

Description

@Horlabrainmoore
let parameters = "{\"query\":\"query ($network: BitcoinNetwork!, $dateFormat: String!, $from: ISO8601DateTime, $till: ISO8601DateTime) {\\n  bitcoin(network: $network) {\\n    transactions(options: {asc: \\\"date.date\\\"}, date: {since: $from, till: $till}) {\\n      date: date {\\n        date(format: $dateFormat)\\n      }\\n      count: countBigInt\\n      feeValue\\n      avgFee: feeValue(calculate: average)\\n    }\\n  }\\n}\\n\",\"variables\":\"{\\n  \\\"limit\\\": 10,\\n  \\\"offset\\\": 0,\\n  \\\"network\\\": \\\"bitcoin\\\",\\n  \\\"from\\\": \\\"2026-01-15\\\",\\n  \\\"till\\\": \\\"2026-01-22T23:59:59\\\",\\n  \\\"dateFormat\\\": \\\"%Y-%m-%d\\\"\\n}\"}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://graphql.bitquery.io")!,timeoutInterval: Double.infinity)
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.addValue("Bearer undefined", forHTTPHeaderField: "Authorization")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
   guard let data = data else {
      print(String(describing: error))
      return
   }
   print(String(data: data, encoding: .utf8)!)
}

task.resume()

@BrainPayEcoxsz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions